-1

There are already several questions on StackOverflow ( Can you get a public Facebook page's feed using Graph API without asking a user to allow? Get public page statuses using Facebook Graph API without Access Token? )concerning my question: I need to get through the graph API the feeds of a public page on facebook.

I followed the instructions but I always get:

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

how can I fix this? I'm going crazy because everyone seems to work except me! thanks

Community
  • 1
  • 1
  • 2
    after hours and hours, by accident I found the problem: The "type application" on facebook of my application was set to "Native / Desktop". I changed for test to "web application" and everything worked! – majinb_igor Jun 17 '12 at 10:13

1 Answers1

0

Based on your description, the error is that you weren't supplying a valid access token with your request.

If the app's type is set to 'Native / Desktop' it's assumed you distributed the app's secret key with the binary, and thus the app access token isn't trusted (and 'getAccessToken' in the PHP SDK will only work when real users log in, it can't fall back to the app token)

If you were attempting to use the app access token to read the page's feed, this would fail in the manner you described.

Igy
  • 43,710
  • 8
  • 89
  • 115
  • thanks, but when I swithed app type to "Web Application", the request to read page's feed using the app access token worked correctly without login a user – majinb_igor Jun 19 '12 at 07:55
  • Yes exactly, when it's a web app the app secret (and thus, the app access token) are valid – Igy Jun 19 '12 at 07:58