Graph API - Get events by owner/creator

后端 未结 4 1600
面向向阳花
面向向阳花 2021-02-01 08:56

Is there a way with the Facebook Graph API to get a list of all events created by a single profile? Our client creates a bunch of events and we want to pull a list of them all.

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 09:32

    This is one of those "there's no good way to get there from here" problems. You can't use FQL, because the creator column isn't indexed. The best solution I can think of at the moment would be using the Graph API to query the events connection of the creator, and filtering out any events that they aren't the creator for. This won't be terribly efficient, since you'll be downloading info about all the user's events, even the ones they didn't create. So, I'd experiment with breaking it down into two queries:

    graph.facebook.com/[user_id]/events?fields=id,owner&limit=1000
    

    and then once you've filtered out all the events they didn't create:

    graph.facebook.com/?ids=[event_ids for the user's events]
    

提交回复
热议问题