Notifications.getList
From Facebook Developer Wiki
Contents |
Description
This method gets all the current session user's Facebook notifications. It is a wrapper around the notification and application FQL tables; you can achieve more fine-grained control by using those two FQL tables in conjunction with the fql.multiquery API call.
Applications must pass a valid session key.
Parameters
| Required | Name | Type | Description | |
| required | session_key | string | The session key of the logged in user. The session key is automatically included by our PHP client. Applications must pass a valid session key. | |
|---|---|---|---|---|
| optional | start_time | time | Indicates the earliest time to return a notification. This equates to the updated_time field in the notification FQL table. If not specified, this call returns all available notifications. | |
| include_read | bool | Indicates whether to include notifications that have already been read. By default, notifications a user has read are not included. |
Response
For details on the columns returned in the alerts and apps arrays, see the documentation for the notification and application FQL tables, respectively.
Example Return XML
<?xml version="1.0" encoding="UTF-8"?>
<notifications_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">
<messages>
<unread>5</unread>
<most_recent>1258728333</most_recent>
</messages>
<pokes>
<unread>5</unread>
<most_recent>1257286083</most_recent>
</pokes>
<shares>
<unread>0</unread>
<most_recent>0</most_recent>
</shares>
<friend_requests list="true">
<uid>UID1</uid>
<uid>UID2</uid>
<uid>UID3</uid>
</friend_requests>
<group_invites list="true">
<gid>34689368662</gid>
<gid>74014297329</gid>
</group_invites>
<event_invites list="true">
<eid>178438479519</eid>
<eid>153331064906</eid>
</event_invites>
</notifications_get_response>
Error Codes
| Code | Description | |
| 100 | Invalid parameter. | |
|---|---|---|
| 102 | Session key invalid or no longer valid (if it's a desktop application and the session is missing). |
Notes
- Desktop applications can call this method to get and display notifications. For example, Facebook for Adobe AIR reads the notifications a user gets, then pops up a toast when one arrives.
