why does posting to facebook page yield “user hasn't authorized the application”

前端 未结 4 1732
猫巷女王i
猫巷女王i 2020-11-28 12:26

I have read the fb docs and written code to publish a message to a facebook \"page\", however I am getting an error that I don\'t expect to see:

(#200) The u         


        
相关标签:
4条回答
  • 2020-11-28 12:42

    status_update is not used anymore. To publish on pages, I had to use both manage_pages and publish_pages.

    0 讨论(0)
  • 2020-11-28 12:43

    You should add permission called status_update, for example

    https://www.facebook.com/dialog/permissions.request?_path=permissions.request&app_id=145634995501895&redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html%3Fdisplay%3Dpage&response_type=token&fbconnect=1&perms=status_update&from_login=1&m_sess=1&rcount=1

    enter image description here

    and i'm able post to page i liked with the access token i get just now: enter image description here

    If you want to post as the admin of the page, you're require both manage_pages and status_update permissions, for example

    https://www.facebook.com/dialog/permissions.request?_path=permissions.request&app_id=145634995501895&redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html%3Fdisplay%3Dpage&response_type=token&fbconnect=1&perms=manage_pages%2Cstatus_update&from_login=1&m_sess=1&rcount=1

    enter image description here

    Cheers

    0 讨论(0)
  • 2020-11-28 12:49

    I found the best way to get a valid token and check permissions was via the Graph API Explorer BUT while Facebook's documentation is extensive it is not always the easiest to follow.

    In the explorer you have to look at both:

    1. The Application Currently at the top and quite subtle, I missed this for ages.
    2. Get Token Dropdown What you click to get a Token, when you click the arrow you can choose pages and other items you have access to for selecting a token for.
    0 讨论(0)
  • 2020-11-28 12:52

    Well, this seems to be a common mistake that most of us make while trying to do an activity in social netwroks. Before trying to put up an open graph action,You need to set the permissions in your initial authorization request . By default you only gain 'read-only' access to their basic information. Settintg up permisson at teh time of authetication is a must for Facebook and LinkedIn APIs..

    See the public_actions section in Facebook open graph permissions here and make relevant changes in the authorization code , and get your issue solved.

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