Graph API / FQL Does not return all events for a page

故事扮演 提交于 2019-12-05 00:09:36

问题


Facebook Page: http://facebook.com/getwellgabby/events/ currently has 8 events on it. I can see them. Non-admins can see them and can join them.

However, when I make calls via the Graph API or FQL, only 4 future events are returned. Results can be seen here: http://getwellgabby.org/events?raw=1 (Scroll to bottom for raw response.)

FQL Query is:

  SELECT eid, name, start_time, end_time, location, venue, description 
        FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = 213367312037345 ) AND end_time > now()
        ORDER BY end_time asc

Inspecting individual event IDs returned via Graph API shows no difference between these events. However, when editing them via the front end, they display in different dialogs.

Two sample events follow. Both were created by the same page admin approx. 24 hours apart. The first event displays properly via an API/FQL call. The second does not. From the front end, the second event displays differently than the first.

Data below was returned using the FB Graph API Expplorer Tool using an Access Token with "create_event" privileges.

Reports Correctly:

{
  "id": "344143808978921", 
  "owner": {
    "name": "Get Well Gabby", 
    "category": "Non-profit organization", 
    "id": "213367312037345"
  }, 
  "name": "Get Well Gabby Day With The Reading Phillies", 
  "description": "Please join [truncated...]", 
  "start_time": "2012-06-10T13:30:00", 
  "end_time": "2012-06-10T16:30:00", 
  "location": "FirstEnergy Stadium", 
  "venue": {
    "street": "1900 Centre Ave.", 
    "city": "Reading", 
    "state": "Pennsylvania", 
    "country": "United States", 
    "latitude": 40.357, 
    "longitude": -75.91434, 
    "id": "223424611014786"
  }, 
  "privacy": "OPEN", 
  "updated_time": "2012-04-25T14:22:57+0000", 
  "type": "event"
}

Does not report correctly:

{
  "id": "128748077259225", 
  "owner": {
    "name": "Get Well Gabby", 
    "category": "Non-profit organization", 
    "id": "213367312037345"
  }, 
  "name": "Get Well Gabby Day With The Wilmington Blue Rocks", 
  "description": "Get Well Gabby Day With [truncated...]", 
  "start_time": "2012-07-29T13:35:00", 
  "end_time": "2012-07-29T16:35:00", 
  "timezone": "America/New_York", 
  "location": "Frawley Stadium", 
  "venue": {
    "id": "148306638522325"
  }, 
  "privacy": "OPEN", 
  "updated_time": "2012-04-25T18:11:35+0000", 
  "type": "event"
}

Note, front end dialog for the event that does not report correctly will not accept additional venue information.


回答1:


You can use since and until to increase the scope of your query.

here is an example using graph api explorer and search events (shows future events) https://developers.facebook.com/tools/explorer/135669679827333/?method=GET&path=search%3Ftype%3Devent%26q%3Da%26limit%3D100%26since%3Dnow%26until%3Dnext%20year


171535666239724/events?since=2010&until=now // all events since 2010 until now

171535666239724/events?since=now&until=2013 // all events from now until 2013

for graph api requests: until, since (a unix timestamp or any date accepted by strtotime http://php.net/manual/en/function.strtotime.php): https://graph.facebook.com/search?until=yesterday&q=orange




回答2:


The issue seems to have resolved itself for now. Thanks if someone following this issue did something at Facebook.



来源:https://stackoverflow.com/questions/10336916/graph-api-fql-does-not-return-all-events-for-a-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!