Creating Facebook event for specific page with FB Graph API

后端 未结 4 1520
情书的邮戳
情书的邮戳 2021-02-02 03:13

I need synchronize events from my CMS to Facebook specific page. I\'m trying to create an event for my created page but still have no result. I can simply create events, related

相关标签:
4条回答
  • 2021-02-02 03:37

    Set the access_token to the page one before making the post. Make sure you app has the "manage_pages" permission for this to work.

    Like this:

    $page = $fbApi->api('/'.<page_id>,'GET',array('fields'=> 'access_token'));
    $fbApi->setAccessToken($page['access_token']);
    
    0 讨论(0)
  • 2021-02-02 03:41

    You need to pass the access token of the managed page, which you can get from graph.facebook.com/me/account (of course passing your access token to get the list of fan pages you manace). You will see there a list of access tokens for each of your fan pages, use those to create events or post to your fanpage.

    0 讨论(0)
  • 2021-02-02 03:41

    Interesting- my experience is exactly the opposite. I tried creating the event with the page_id parameter and got a Permissions Error. Removed the page_id and it worked fine. The trick was to use the application access token rather than user one.

    0 讨论(0)
  • 2021-02-02 03:52

    «Creates an event on behalf of the user if the application has an active session key for that user; otherwise it creates an event on behalf of the application.» — Source

    Does this answer your question?

    0 讨论(0)
提交回复
热议问题