Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Facebook RSVP using the JS SDK
<div id="fb-root"></div>
window.fbAsyncInit = function() {
appId : '721489701236648',
status : true,
xfbml : true
// This is a Graph API called in the context of the logged-in user
FB.api("/300843286737953/attending", function(r){
console.log("attending", r)
FB.api("/300843286737953/attending", "POST", function(r){
console.log("rsvp", r)
// Un-RSVP
FB.api("/300843286737953/attending", "DELETE", function(r){
console.log("un-rsvp", r)
}, {scope: "rsvp_event"});
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); = id;
js.src = "//";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

This comment has been minimized.

Copy link

@Bahtx Bahtx commented Apr 9, 2014

What does this allow us to do on facebook?


This comment has been minimized.

Copy link
Owner Author

@scottburton11 scottburton11 commented Apr 9, 2014

Isolated example, but generally FB.api inside the FB.login callback allows arbitrary Graph API requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment