Admin.getAllocation
From Facebook Developer Wiki
Contents |
Description
Returns the current allocation limits for your application for the specified integration points. Allocation limits are determined daily. Integration points include:
-
notifications_per_day- The number of notifications your application can send on behalf of a user per day. These are user-to-user notifications. -
announcement_notifications_per_week- The number of notifications your application can send to a user per week. These are application-to-user notifications. -
requests_per_day- The number of requests your application can send on behalf of a user per day. -
emails_per_day- The number of email messages your application can send to a user per day. If you call this method with the optionaluserparameter, a value of -1 indicates that you can send an unlimited amount of email to that user. -
email_disable_message_location- The location of the disable message within emails sent by your application. '1' is the bottom of the message and '2' is the top of the message.
These limits also appear on the Allocations tab on the Insights dashboard (click on "Stats") for your application in the Facebook Developer application.
Parameters
| Required | Name | Type | Description | |
| required | api_key | string | The application key associated with the calling application. If you specify the API key in your client, you don't need to pass it with every call. | |
|---|---|---|---|---|
| call_id | float | 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. If you specify the call ID in your client, you don't need to pass it with every call. | ||
| sig | string | An MD5 hash of the current request and your secret key, as described in the How Facebook Authenticates Your Application. Facebook computes the signature for you automatically. | ||
| v | string | This must be set to 1.0 to use this version of the API. If you specify the version in your client, you don't need to pass it with every call. | ||
| integration_point_name | string | The name of the integration point. Integration points include notifications_per_day, announcement_notifications_per_week, requests_per_day, emails_per_day, and email_disable_message_location. | ||
| optional | user | int | The user ID for the specific user whose allocations you want to to check. Specifying a user ID is relevant only with respect to the emails_per_day integration point for users who granted the email permission prior to the 2008 profile design update, per the note on notifications.sendEmail. | |
| format | string | The desired response format, which can be either XML or JSON. (Default value is XML.) | ||
| callback | string | Name of a function to call. This is primarily to enable cross-domain JavaScript requests using the <script> tag, also known as JSONP, and works with both the XML and JSON formats. The function will be called with the response passed as the parameter. |
Example Requests
$facebook->api_client->admin_getAllocation('notifications_per_day')
Response
This method returns the allocation limit for your application for the specified integration point.
Error Codes
| Code | Description | |
| 1 | An unknown error occurred. Please resubmit the request. | |
|---|---|---|
| 4 | The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed. | |
| 100 | One of the parameters specified was missing or invalid. | |
| 200 | Permissions error. | |
| 801 | Data quota exceeded. | |
| 805 | Database error. |
Notes
- This method does not require a
session_key, unless it is being called by a desktop application.
