Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph API – access denied for public page event

I'd like to receive data on a public page event via the graph api. I have been doing this for quite a while now, but suddenly my code is not working any longer.

Take for example the page ID 128431033877314. A graph api GET call to

128431033877314/events

delivers – as expected – the list of events for this page. Amongst them, for example, the event with ID 158032248286483. Trying to receive any data for this event fails, returning my favorite graph api error:

{ "error": { "message": "Unsupported get request. Object with ID '158032248286483' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", "type": "GraphMethodException", "code": 100, "error_subcode": 33, "fbtrace_id": "GN5BhnWsN5O" } }

I have tried accessing /158032248286483 and 158032248286483?fields=id, I have used the graph API explorer to check different versions (2.6 and 2.12), I have tried with user, page and app access tokens. All in vain. Same goes for any other event returned.

As I said – this has most certainly been working before. I can hardly imagine this being a bug, as it would affect quite an important piece of graph api functionality. So I assume I am missing something here. Could somebody please tell me what it is?

Thanks so much in advance!

like image 290
panepeter Avatar asked Apr 06 '18 07:04

panepeter


1 Answers

Yes, @CBroe, is right, in lights of "Cambridge Analytica" issue, Facebook was recently closed/deprecated/changed some endpoints. Reading bug reports many people complaining about lost access to some endpoints related to Events, Groups and Pages APIs. But, there actually two types of changes they did: some endpoints of Event and Groups APIs are deprecated means nothing you can do right now. (They will change/replace/tune it in future). And second part related to Pages API, that actually can be fixed with some coding on your side. For the Pages API they just forced May 8 breaking changes to take effect immediately. You need to migrate your requests to use "page access token" instead of "user access token" when you use those endpoints.

More info you can check there:

Blog post about actions they have taken: https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes/

Facebook breaking changes: https://developers.facebook.com/docs/graph-api/changelog/version2.11

like image 89
Artyom Avatar answered Sep 30 '22 13:09

Artyom