Search code examples
facebookfacebook-graph-apifacebook-events

Facebook Graph API event-id/comments?since=2014-02-01&until=2014-02-10 , Date filter has no effect


  1. I am trying to bring comments made on a particular event by targeting this URL: https://graph.facebook.com/1466384840257158/comments
  2. I am passing the user_access_token
  3. I have two comments at present on this event made on the same day(2014-03-29)
  4. Now I try to pass a date which should bring an empty data result/object like this: https://graph.facebook.com/1466384840257158/comments?since=2011-01-01&until=2014-01-10
  5. This request has no effect, it still shows me the two comment made on the 29th
  6. I have tried the same kind of date range on my user-id/feed and it gave me an empty data object.
  7. Finally i tried event-id/feed (before trying date filter) and it gave me the following error

.

{
    "error": {
        "message": "An unexpected error has occurred. Please retry your request later.", 
        "type": "OAuthException", 
        "code": 2
    }
}

Could you please guide me about date filter on that particular query (point4) or if you have any other idea to use date filter on comments made for an event.


Solution

  • Comments use Cursor-based Pagination, so you cannot use since or until on the comments endpoint (these parameters would work f.ex. for the feed endpoint).

    To get the comments in a time range you have to fetch all comments from NOW to the start of the time range, f.ex. with https://graph.facebook.com/1466384840257158/comments?filter=stream&limit=1000+paging (the filter=stream will order the result with the timestamp).