Search code examples
facebookfacebook-graph-apifacebook-events

Facebook User vs Event (get RSVP status for user on event)


Is there any better way of checking RSVP status of user (logged in our application) vs. specific Event through Graph API, than calling /v2.3/{user_id}/events and going through all events to find the one we're interested into and get the rsvp_status field there?

What I've tried, and what didn't work:

  • /v2.3/{user_id}/events/{event_id}
  • /v2.3/{user_id}/events?event={event_id}
  • /v2.3/{user_id}/events?event_id={event_id}
  • calling all of them, to find out if user is in any of RSVP groups: /v2.3/{event_id}/{attending|invited|maybe|declined|noreply}?user={user_id}

Also FQL is not a solution, if anybody wants to C&P existing FQL answers, because that's deprecated since API v2.0

This related answer is also wondering about efficiency on using Graph API, because pulling all user's events and going through them is both time and resource expensive operation


Solution

  • Ok, so I found the answer, which is quite simple:

    /v2.3/{event_id}/invited?user={user_id}

    Currently this method will

    • return nothing, if user is not yet part of event (was never invited and never attended/maybe himself)
    • return one object, with user object and his rsvp_status

    /invited (what we've seen from testing) contains both users that were invited to the event, and users that joined the event themselves (so don't get confused by the word invited, at least unless facebook changes the API again)