c# - Facebook Application publish on facebook page -


i want facebook application create events in facebook page. use application able publish events facebook page, don't want give admin or contributor everyone, want web app ( appid + secret code) have rights publish

when i'm trying this:

client.accesstoken = "{app-id}|{app-secret}"; dynamic result = client.post("/{page-id}/events", new{                     name = "testevent",                     start_time = "2014-04-11t19:00:00-0700",                     end_time = "2014-04-11t20:00:00-0700",                 } ); 

i received error

{   "error": {     "type": "exception",      "message": "you must admin of specified page perform requested action.",      "code": 1373019   } } 

any idea?

you should following:

  1. get page access token via /me/accounts endpoint (the logged in user must administrator of page). can via https://developers.facebook.com/tools/explorer?method=get&path=me%2faccounts sure have requested manage_pages, create_event , publish_stream permissions beforehand.

  2. exchange short-lived page access token non-expiring 1 described here: what steps getting long lasting token posting facebook fan page server

  3. use newly generated page access token in app


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -