Trying to update a Facebook event using the Graph API (Facebook C# SDK)
I am trying to update the description of a Facebook event using the Facebook C# SDK. I have granted the following permission to my application:
'publish_stream,email,manage_pages,user_events,create_event,rsvp_event'
The event I am trying to update is one of my own events, so I believe I should be able to update it.
In the code below "9999" is the event id of the event I created, and the event I am trying to amend:
Author开发者_如何转开发izer authorizer = new Authorizer();
FacebookClient fbapp = new FacebookClient(authorizer.Session.AccessToken);
Console.Write(fbapp.Get("9999"));
dynamic parameters = new ExpandoObject();
parameters.description = "the new description";
fbapp.Post("9999", parameters);
The fbapp.Get works fine and returns the details of the event.
The problem is with the Post method, this returns (OAuthException) (#200) Permissions error
Any ideas as to where I am going wrong?
This issue is in fact a bug in the Facebook Graph API, see here for the bug report
It appears to be the case that you can only use the Graph API to edit events created by your app, and not existing events created by users within Facebook.
Hopefully it will be fixed soon!
If you really have all permissions, I think you should include every mandatory field in the parameters (as I haven't done this, I can only guess!) and not only the field you wish to edit.
Hope this has helped you Andrew.
精彩评论