event.create()

Sep 1, 2008 at 12:34 AM
Hello,

I was just wondering if anyone successfully got this working? I seem to be coming up with an error:

Creating and modifying events requires the extended permission create_event


Is there anything that I am doing wrong or issit a bug? I have taken note that the events test is failing:
http://www.codeplex.com/FacebookToolkit/Thread/View.aspx?ThreadId=33765

Any updates on that?

Thanks
Sep 1, 2008 at 4:39 AM
Edited Sep 1, 2008 at 4:40 AM
Realized the problem...shoulda looked harder into the facebook api. For anyone who wonders:

http://wiki.developers.facebook.com/index.php/Extended_permission

There is a bug in the Facebook API related to that though, in the <fb:prompt-permission> tag. sighs..</fb:prompt-permission>
Sep 17, 2008 at 6:14 AM
Just a lil update...I kinda started digging in the code a bit and found that there is perhaps a line of code that might be missing in API.events.create.

Currently, the part of the method looks like this

var dict = new Dictionary<string,string> {
{"description", event_info.description},
{"end_time", event_info.end_time.ToString()},
{"category", event_info.event_type},
{"subcategory", event_info.event_subtype},
{"host", event_info.host},
{"location", event_info.location},
{"name", event_info.name},
{"start_time", event_info.start_time.ToString()},
{"tagline", event_info.tagline},
}

</string,string>
After some playing around, I come to realise that the required parameter city is missing. Hence I believe that this line should be included.

{"city", event_info.venue.city}

Through further testing, I took the created JSON array to test in the Facebook API test console and it successfully created the event. However, there is still a bug somewhere that I am unable to find. Since the JSON array created now work, I assume it is somewhere further within the code that is throwing the exception. I cant find this as I dont know how to debug code within Facebook platform. This is the exception that gets thrown:


at facebook.API.ErrorCheck(String xml)
at facebook.API.processResponse(WebResponse webResponse)
at facebook.API.SendRequest(IDictionary`2 parameterDictionary, Boolean useSession)
at facebook.API.SendRequest(IDictionary`2 parameterDictionary)
at facebook.events.create(facebookevent event_info) at visInternetTicketing.fbCreateEvent.CreateEvent() at visInternetTicketing.fbCreateEvent.Page_Load(Object sender, EventArgs e)

Invalid parameter

Does that make sense to anyone? Anyone care to shed some light to this?
Jan 23, 2009 at 6:37 PM



hi kirbywnz!

I got Facebook Events work, you are right that they missed city. So we need to add it. But addition  like {"city", event_info.venue.city} don't work as its leads to other error.

So , what i did is removed  {"tagline", event_info.tagline} and added "city", event_info.city}

and added new string to facebookevent class and to facebook.xsd for mapping and its working fine .


Feb 24, 2009 at 5:55 AM
Edited Feb 24, 2009 at 2:58 PM
Hi NexGenIT
Glad to know that you got event.create() working. Well I too got it working. But there is some thing strange that is going on now! In the past two weeks if I give an invalid city name/state it used to raise an "Invalid Parameter" Facebook Exception and if we give a valid city/state name (in proper spelling) it used to work but I have not noticed at the time whether city/state details were getting saved. But now that error is not being thrown irrespective of the validity of the city/state info! It's simply creating the event without the city/state info. May be facebook have made city as non-mandatory.
I want the city info to be saved that is not happening right now.  I tried out the way you ve explained. So in the file "LinqToXsdSource.cs" I ve added the following lines to the class "public partial class facebookevent : XTypedElement, IXMetaData" :

public string city
{
    
get
{
    XElement x =
this.GetElement(XName.Get("city", "http://api.facebook.com/1.0/"));
    
return XTypedServices.ParseValue<string>(x, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype);
}
set
{
this.SetElement(XName.Get("city", "http://api.facebook.com/1.0/"), value, XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).Datatype);
}
}

 

But I am getting a null reference exception in the set block when I try assign a value for the city say for example : Delhi. I would be grateful if you could send the edited files to my email "tonymathewt@hotmail.com"

 

 

May 18, 2009 at 11:43 AM

i implement the solution but now i am facing  the error "Incorrect signature".please can anybody mail me the complete solution at tamoorakram@hotmail.com

thanks

May 18, 2009 at 3:43 PM

I believe "Incorrect signature" in FB means you've set the name of your app in the web.config as something diffrent than in the FB app settings under 'Basic'

Oct 21, 2009 at 11:11 PM

Hi everyone. I am desperately in need of some examples of how to post events to a facebook group using a PHP script on my website. Can anyone help or suggets whether or not this can be done?