1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Intermittent permissions error

Discussion in 'Facebook API' started by David Williamson, Feb 6, 2019.

  1. #1
    If anybody knows the answer to this one you're my friend for life!

    I administer a website for an organisation that also has a Facebook page. The website contains details of theatrical events that the organisation publicises. I've coded a scheduled script that uses the Facebook Graph API to post about upcoming events on the Facebook page.

    To do this I created a Facebook app. I generate a user access token (I am an administrator of the Facebook page) and then a page access token using the Graph API explorer. I then I extend the page access token to make it enduring using the access token debugger. My script then uses the page access token for the permission to publish to the page.

    Now...

    When I originally submitted the app for Facebook app review, I read that in order to publish to pages I needed the publish_pages and manage_pages permission. So I requested both. I submitted a screencast showing the script running and posting about events to a test page.

    The app review kept coming back saying that I wasn't showing how the application used the manage_pages permission and so rejecting that specific request. After a while I read that manage_pages "Grants an app permission to retrieve Page Access Tokens for the Pages and Apps that the person administers". Ah... I thought. Maybe because I am generating a page access token using the Graph API explorer then the app itself doesn't need this permission and so I removed it from the app review request.

    The app passed review. I went live. Everything worked fine.

    Then, a few days ago, I got an error message when the scheduled script failed to post about an event. The error message was:
    SEMrush
    insufficient_scope
    (#200) Requires either publish_to_groups permission and app being installed in the group, or manage_pages and publish_pages as an admin with sufficient administrative permission

    That happened once. The next time the scheduled script tried to post about an event to the page, it worked.

    Today (several days after that first error with several successful posts in the intervening period) the problem started happening again. This time it has prevented four attempted posts today, i.e. it doesn't show signs of going away again immediately like it did last time.

    I used the access token debugger to check the page access token that I'm using. All looks well there.

    Any ideas?
     
    David Williamson, Feb 6, 2019 IP
    SEMrush
  2. Spoiltdiva

    Spoiltdiva Prominent Member

    Messages:
    6,368
    Likes Received:
    1,833
    Best Answers:
    50
    Trophy Points:
    395
    #2
    The access token that you have provided doesn't have the scope required to perform the operation. So......create:users scope. Get back in there and look around, probably something simple that you overlooked or not put in.
     
    Spoiltdiva, Feb 6, 2019 IP
  3. David Williamson

    David Williamson Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    I don't understand how that could be since it is used for exactly the same operation every time and works most of the time. I'm only experiencing this error intermittently.
     
    David Williamson, Feb 6, 2019 IP
  4. David Williamson

    David Williamson Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Here's some more information on this and an update.

    The page access token that I am using has the following scope: pages_show_list, publish_pages, public_profile

    I am using this to post status updates to the page that the access token is associated with.

    And...

    After a day not working, on the day that I started this thread, the next day and since then it has started working again!

    Obviously, it's working now so I'm a bit happier but I'd prefer it if I could work out why it keeps intermittently failing for a period. So, any ideas appreciated.
     
    David Williamson, Feb 8, 2019 IP