0

I am writing an Android app where, among other things, the spec calls for all the posts on a specific Facebook page to be available in a ListView. So far this has worked fine, but today I discovered that the previous developer had used a user access_token to get access to the Open Graph API to get at this page. I discovered this because the access_token expired.

Since then I have followed the instructions in

https://developers.facebook.com/docs/opengraph/howtos/publishing-with-app-token/ https://developers.facebook.com/docs/howtos/login/login-as-app/

to get an app access token; however, when I try to access the page feed like this:

https://graph.facebook.com/[PAGE]/posts?access_token=[APP_ID]|[OTHER_DATA]

I get:

{
    error: {
        message: "An access token is required to request this resource.",
        type: "OAuthException",
        code: 104
    }
}

however, chopping the access token around in any way results in

{
    error: {
        message: "Invalid OAuth access token signature.",
        type: "OAuthException",
        code: 190
    }
}

so clearly Facebook recognizes the access token but refuses it. I noticed in the first Facebook developers link above that

Note that the app access token is for publishing purposes permitted by the publish_actions permission. You will be unable to retrieve information about the status update post with the given ID using the app access token. Instead, you should use a user access token for such purposes.

What I would like to know is, what actions are possible with an app token, and what actions are impossible with one?

Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
  • The Facebook API documentation would be your best resource for this kind of information. – Robert Harvey Mar 27 '13 at 17:56
  • The Facebook API documentation is pretty incomplete in places and I had trouble finding the answer to this specific question in it, though, as you can see, I did find out enough to make an app access_token. If you could indicate where to look in the docs that would be amazing though. – Andrew Wyld Mar 27 '13 at 18:15
  • 1
    Your access_token should have the proper permissions. To get the correct access token manually, you can use the API Explorer. https://developers.facebook.com/tools/explorer/ – dannyroa Mar 27 '13 at 18:27
  • @dannyroa Will a token got through the graph explorer expire? – Andrew Wyld Mar 28 '13 at 10:13
  • I have reused an access token for long periods of time. I don't have a definitive answer but see this: http://stackoverflow.com/questions/2687770/do-facebook-oauth-2-0-access-tokens-expire. – dannyroa Mar 28 '13 at 17:59

0 Answers0