Graph:Event
From Facebook Developer Wiki (FbDevWiki.com)
Specifies information about an event, including the location, event name, and which invitees plan to attend. The following examples show how to create and edit an event:
Make an event:
curl -d "name=test&start_time=1272718027&location=someplace" https://graph.facebook.com/PROFILE_ID/events
Edit its location:
curl -d "location=elsewhere" https://graph.facebook.com/113252725382372
RSVP to an Event
curl -d "access_token=XXX" https://graph.facebook.com/EVENT_ID/{attending|declined}
Contents |
Example
https://graph.facebook.com/331218348435 (Facebook Developer Garage Austin)
Properties
Name | Description | Permissions | Returns | Condition |
---|---|---|---|---|
id | The event ID | Publicly available | A JSON string | |
owner | The profile that created the event | Publicly available | A JSON object containing id and name fields |
|
name | The event title | Publicly available | A JSON string | |
description | The long-form HTML description of the event | Publicly available | A JSON string | |
start_time | The start time of the event, as you want it to be displayed on facebook | Publicly available | A JSON string containing an ISO-8601 formatted date/time or a UNIX timestamp; if it contains a time zone (not recommended), it will be converted to Pacific time before being stored and displayed | |
end_time | The end time of the event, as you want it to be displayed on facebook | Publicly available | A JSON string containing an ISO-8601 formatted date/time or a UNIX timestamp; if it contains a time zone (not recommended), it will be converted to Pacific time before being stored and displayed | |
location | The name of the location for this event | Publicly available | A JSON string | |
venue | The location of this event | Publicly available | A JSON object containing street , city , state , zip , country , latitude , and longitude fields |
|
privacy | The visibility of this event | Publicly available | A JSON string containing 'OPEN', 'CLOSED', or 'SECRET' | |
updated_time | The last time the event was updated | Publicly available | A JSON string containing a IETF RFC 3339 datetime |
Connections
Name | Description | Permissions | Returns |
---|---|---|---|
feed | This event's wall | Publicly available | An array of Post objects
|
noreply | All of the users who have been not yet responded to their invitation to this event | Available to everyone on Facebook | A JSON array containing objects with id , name and rsvp_status fields
|
maybe | All of the users who have been responded "Maybe" to their invitation to this event | Available to everyone on Facebook | A JSON array containing objects with id , name and rsvp_status fields
|
invited | All of the users who have been invited to this event | Available to everyone on Facebook | A JSON array containing JSON objects with id , name and rsvp_status fields
|
attending | All of the users who are attending this event | Available to everyone on Facebook | A JSON array containing objects with id , name and rsvp_status fields
|
declined | All of the users who declined their invitation to this event | Available to everyone on Facebook | A JSON array containing JSON objects with id , name and rsvp_status fields
|
picture | The event's profile picture | Publicly available | Returns a HTTP 302 with the URL of the event's picture |
Publishing
Requires the create_event
permission.
To publish an event, POST
the event's title
, start_time
and end_time
at http://graph.facebook.com/PROFILE_ID/events
.
curl -F 'access_token=...' \ -F 'name=My birthday' \ -F 'start_time=' \ -F 'end_time=' \ https://graph.facebook.com/me/events
You can also specify a photo for an event by passing in a picture
with the request. Details can be found in this How To: Create Facebook Events Using Graph API.