Search code examples
facebookfacebook-graph-api

Facebook Graph API - Fetch public event


I am new to the Facebook GraphAPI, the idea is to use it from Java facebook-sdk. But at the moment I am just trying to run a simple request to fetch a public event

https://graph.facebook.com/v11.0/{event_id}?access_token={access_token}

But I am getting this error: { "error": { "message": "Unsupported get request. Object with ID 'XXXXX' 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": "Apc-nisB6j0fD2LB--0gTSa" } }

I wonder if I need more permissions from organiser of the event, but the event says "Public · Anyone on or off Facebook"

So why would we need permissions? I just need to fetch some data from the event like name, description and cover url.. I could do it by simple parsing the source code of the page, but API will be much more efficient. Could it be because its just postman or browser?

Thanks.


Solution

  • You don't need Facebook Marketing Partner status to get info about events.

    All you need is:

    1. App with "in development" status,
    2. User access token obtained from https://developers.facebook.com/tools/explorer/

    Create a GET request, for example

    https://graph.facebook.com/**EVENT-ID-HERE**?fields=cover,name,description,start_time,end_time,id,attending_count,created_time,declined_count,interested_count,maybe_count,event_times,place,updated_time,ticket_uri,type,discount_code_enabled,noreply_count&access_token=**ACCESS-TOKEN**
    

    Its worth to note, that

    1. You should be "Interested" or "Going" to an event which data you want to GET info;
    2. Event ID's should be extracted manually.

    For the idea I personally do in this way:

    1. Copy paste all event links to google sheet (and pressing interest)
    2. With =SPLIT[cell;"/"] sheet formula I extract event IDs
    3. Then I run script, that gets all the info Event contains.

    Sorry for my unprofessional way of explaining things, I am not a Developer and I found this question because I am looking for answer about how to extract event cover photo without a specific App status. :))

    I hope that this helps or anyone can explain this better.