Events.get
From Facebook Developer Wiki
Contents |
Description
Returns all visible events according to the filters specified. You can use this method to find all events for a user, or to query a specific set of events by a list of event IDs (eids).
If both the uid and eids parameters are provided, the method returns all events in the set of eids that are associated with the user. If no eids parameter are specified, the method returns all events associated with the specified user.
If the uid parameter is omitted, the method returns all events associated with the provided eids, regardless of any user relationship.
The uid can be replaced by gid in order to get events hosted by a group instead of by an individual user.
If both parameters are omitted, the method returns all events associated with the session user.
The start_time and end_time parameters specify a (possibly open-ended) window in which all events returned overlap. Note that if start_time is greater than or equal to end_time, an empty top-level element is returned.
This method no longer requires a session key. However if you call this method without an active user session, you can only get the events for which your application was the creator; you can see only those event attendees who authorized your application. Applications can create events for users if the users grant the application the create_event extended permission.
Parameters
| Required | Name | Type | Description | |
| optional | uid | int | Filter by events associated with a user with this uid. | |
|---|---|---|---|---|
| eids | array | Filter by this list of event IDs. This is a comma-separated list of event IDs. | ||
| start_time | int | Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound. | ||
| end_time | int | Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound. | ||
| rsvp_status | string | Filter by this RSVP status. The RSVP status should be one of the following strings:
|
Response
Events are only visible if they are not secret. If no such events are found, the method returns 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 are 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 appears in the following format:
Note that the start_time and end_time returned are the times which were input by the event creator, converted to UTC after assuming that they were in Pacific time (Daylight Savings or Standard, depending on the date of the event), then converted into Unix epoch time.
Example Return XML
FQL Equivalent
FQL queries take the form: SELECT <fields> FROM <table> WHERE <conditions>
This function is similar to doing the following FQL query, with the appropriate parameters filled in:
Notes
You can call this method using a session secret, and not the application secret (for example, for a Facebook Connect site or desktop application).
