Post to a facebook page without “manage_pages” permission using php

前端 未结 1 787
谎友^
谎友^ 2020-11-29 10:33

I have a website that contains blog post. we need to post blogs automatically to facebook page. Curently I could post to my timeline. But I could\'nt post to facebook page.

相关标签:
1条回答
  • 2020-11-29 11:09

    Request a new User Access Token by using the Graph API Explorer (with manage_pages permission, eventually in conjunction with publish_pages). Be sure to use one of your own apps, because you want to exchange the generated (short-lived) access token to a long-lived one:

    Copy the newly generated User Access Token from the according form field from the Graph Explorer, open a new browser tab and paste a URL like the following

    https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={your_app_id}&client_secret={your_app_secret}&fb_exchange_token={user_token_from_last_step}
    

    This will create a long-lived User Access Token. Now, copy this new Access Token from the browser tab's content to the Graph Explorer (into the according form field for Access Tokens).

    Now, you can call /me/accounts with this Access Token, and you'll receive a list of the pages you administer. Choose a Page Access Token from the list, and verify the generated token via

    https://developers.facebook.com/tools/debug/accesstoken?q={generated_page_token}
    
    0 讨论(0)
提交回复
热议问题