criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 176 forks source link

Event retrieval broken? #86

Closed zach-delong closed 9 years ago

zach-delong commented 9 years ago

I have a situation where I am trying to retrieve event data from a large set of Facebook pages via the batch API. I am working from something like this:

    var  pages = Array();
    for(var i=properties.index; i<properties.id.length; i++)
    {
        pages.push({
            relative_url: properties.id[i] + "/events?fields=id",
            method: 'GET'
        });
    }
    console.log("Pages being inspected.");
    console.info(pages);

    //Request batch of events from Facebook
    graph.batch(pages, function(error, result){
        console.log("Data facebook returned.");
        console.info(result);
     });

No matter what I do, the events edge comes back empty. Fields, no fields, etc. I have used the graph explorer to validate that the events are in-fact there and the key I'm using in the graph explorer is the same as what I'm using in my application.

Has anyone seen a similar issue? Try using 587297284709320/events?fields=id as an example page.

zach-delong commented 9 years ago

The issue here was actually not a problem of fbgraph but of Facebook not applying the correct version number to the query. I'm not sure why this form works on retrieving a page, but if you prepend /v2.4/ onto the url, it works fine.

RWOverdijk commented 8 years ago

Is it also possible to fetch events using this module without using the batch method?

zach-delong commented 8 years ago

Yeah, all you're doing is accessing an edge of a node. If you just post the page 'normally' it should work.