Jonathan
Jonathan

Reputation: 4918

How to make a user subscribe to an event in facebook using Graph API?

I would like to users when added to this website event registration also subscribe to the event in the facebook.
The system is already asking for the "create_event" extra permission, I am not finding how to subscribe the user to a particular event after it logged in by graph api. How can I do that?

Thanks,
Joe

Upvotes: 2

Views: 3493

Answers (1)

ifaour
ifaour

Reputation: 38135

It's documented in the event object page:

// RSVP to an Event  
    curl -d "access_token=XXX"  
          https://graph.facebook.com/EVENT_ID/{attending|declined}

So you need to grant the rsvp_event permission.
Example using the php-sdk:

$facebook->api("/EVENT_ID/attending", "post", array("access_token" => "XXXXX"));

Upvotes: 4

Related Questions