3

For my website I use the Facebook API to get the events from a few Facebook pages. For this purpose I have created a Facebook app.

However, even though this used to work before, the API now returns an error:

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

Here are the steps to reproduce the error:

  1. Go to app's dashboard on https://developers.facebook.com/apps

  2. Get the app id (APP_ID) and the app secret (APP_SECRET)

  3. Use the app id and the app secret to get an access token by using this url:

    https://graph.facebook.com/oauth/access_token?client_id=APP_ID &client_secret=APP_SECRET&grant_type=client_credentials

  4. This returns something like

    {"access_token":"123412342134|f34f34f32fc3rc4rc324r-X","token_type":"bearer"}

  5. I then use this access token to access the events

    https://graph.facebook.com/v2.12/{11239244970}/events/?fields={id,name}&access_token={123412342134|f34f34f32fc3rc4rc324r-X}

  6. However, this returns the error mentioned above, "Invalid OAuth access token signature.".

I'm stuck here. None of the posts on here seem to solve my problem.

I've already tried resetting the app secret, but that didn't help. Any hints are greatly appreciated!

Sebastian
  • 831
  • 2
  • 13
  • 36
  • Yes Facebook changed a bunch of things. Read their blog posts and changelogs – WizKid Apr 13 '18 at 20:07
  • Thanks @WizKid. I have checked their recent updates and couldn't find anything that would give me any indication about what's going on here. Any ideas? – Sebastian Apr 13 '18 at 20:32
  • What did you read? https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes/ said that the RSVP list is removed from the Events API. – WizKid Apr 13 '18 at 20:41
  • Ah. good call. That /attending/ shouldn't be there. I'm just trying to get event details, not the RSVPs. Will change that in the question. Same issue however remains if /attending/ is removed. – Sebastian Apr 13 '18 at 20:53

2 Answers2

1

It would appear that the reason for this error is that Facebook currently only returns events for pages using the Pages API if you use a user access token and that user is attending, is interested in or has been invited to the events of the page (as answered by @unknown_b to a related question over here).

Sebastian
  • 831
  • 2
  • 13
  • 36
1

To get the Client Access Token for an app, do the following:

Sign into your developer account. On the Apps page, select an app to open the dashboard for that app. On the Dashboard, navigate to Settings > Advanced > Security > Client token.

https://developers.facebook.com/docs/facebook-login/guides/access-tokens#errors