Facebook Methods description: events.get

Returns all visible events according to the filters specified. This may be used to find all events of a user, or to query specific eids.
Parameters
| string | api_key | The application key associated with the calling application. |
| string | session_key | The session key of the logged in user. |
| float | call_id | The request’s sequence number. Each successive call for any session must use a sequence number greater than the last. We suggest using the current time in milliseconds, such as PHP’s microtime(true) function. |
| string | sig | An MD5 hash of the current request and your secret key, as described in the authentication guide. |
| string | v | This must be set to 1.0 to use this version of the API. |
| string | format | Optional - desired response format. Either “XML” (default) or “JSON”. |
| string | callback | Optional - wrap the response inside a function call. This is primarily to enable cross-domain javascript requests using the <script> tag, sometimes known as “JSONP“. This works with both XML and JSON. |
| int | uid | Optional - Filter by events associated with a user with this uid |
| array | eids | Optional - Filter by this list of event ids. This is a comma-separated list of eids. |
| int | start_time | Optional - Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound. |
| int | end_time | Optional - Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound. |
| string | rsvp_status | Optional - Filter by this RSVP status. |
This method returns all events satisfying the filters specified. The method can be used to return all events associated with user, or query a specific set of events by a list of eids. If both the uid and eids parameters are provided, the method returns all events in the set of eids, with which the user is associated. If the eids parameter is omitted, the method returns all events associated with the provided user.
If, instead, the uid parameter is omitted, the method returns all events associted with the provided eids, regardless of any user relationship.
If both parameters are omitted, the method returns all events associated with the session user.
start_time and end_time parameters specify a (possibly open-ended) window which all events returned will overlap. Note that if start_time is greater than or equal to end_time, an empty top-level element is returned.
The RSVP status should be one of the following strings:
- attending
- unsure
- declined
- not_replied
Example Return XML
<?xml version="1.0" encoding="UTF-8"?>
<events_get_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
<event>
<eid>1037629024</eid>
<name>Technology Tasting</name>
<tagline>Who said Engineering can't be delicious?</tagline>
<nid>12409987</nid>
<pic>http://photos-628.facebook.com/ip006/object/1345/48/s1037629024_30775.jpg</pic>
<pic_big>http://photos-628.facebook.com/ip006/object/1345/48/n1037629024_30775.jpg</pic>
<pic_small>http://photos-628.facebook.com/ip006/object/1345/48/t1037629024_30775.jpg</pic>
<host>Facebook</host>
<description>Facebook will be hosting technology thought leaders and avid software engineers for a social evening of technology tasting. We invite you to connect with some of our newest technologies and innovative people over hors d'oeuvres and wine. Come share ideas, ask questions, and challenge existing technology paradigms in the spirit of the open source community.</description>
<event_type>Party</event_type>
<event_subtype>Cocktail Party</event_subtype>
<start_time>1172107800</start_time>
<end_time>1172115000</end_time>
<creator>1078</creator>
<update_time>1170096157</update_time>
<location>Facebook's New Office</location> <venue>
<city>Palo Alto</city>
<state>CA</state>
<country>United States</country>
<latitude>37.775</latitude>
<longitude>-122.418</longitude>
</venue>
</event>
</events_get_response>
Response
Events are only visible if they are not secret. If no such events are found, the method will return an empty events_get_response element. The nid field will be 0 for global events. Note the following size constraints on photos returned:
- pic - URL of event photo, with max width 100px and max height 300px. May be blank.
- pic_big - URL of event photo, with max width 200px and max height 600px. May be blank.
- pic_small - URL of event photo, with with max width 50px and max height 150px. May be blank .
Privacy note: Event creators will be visible to an application only if the creator has not turned off access to the Platform or used the application’; If the creator has opted out , the creator element will appear in the following format:
<creator xsi:nil="true"/>
FQL Equivalent
This function is similar to doing the following FQL query, with the appropriate parameters filled in:
SELECT eid, name, tagline, nid, pic, pic_big, pic_small, host, description,
event_type, event_subtype, start_time, end_time, creator, update_time,
location, venue
FROM event WHERE eid IN (SELECT eid FROM event_member
WHERE uid=uid AND rsvp_status=rsvp_status) AND
eid IN (eids) AND
end_time >= start_time AND
start_time < end_time
Error codes
| 1 | An unknown error occurred. Please resubmit the request. |
| 2 | The service is not available at this time. |
| 4 | The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed. |
| 5 | The request came from a remote address not allowed by this application. |
| 100 | One of the parameters specified was missing or invalid. |
| 101 | The api key submitted is not associated with any known application. |
| 102 | The session key was improperly submitted or has reached its timeout. Direct the user to log in again to obtain another key. |
| 103 | The submitted call_id was not greater than the previous call_id for this session. |
| 104 | Incorrect signature. |
Tags: events.get, method, méthode, methods
Related Post
1 Comment(s)
Comments RSS TrackBack Identifier URI
Leave a comment

[…] Tools 4 Facebook News wrote an interesting post today on Facebook Methods description: events.getHere’s a quick excerptReturns all visible events according to the filters specified. This may be used to find all events o […]