Error Codes

Problem

My API calls don’t work! I’m getting errors back!

Solution

Don’t panic! 100- and 200-class errors are Facebook’s way of telling you that there’s something wrong with your API calls. The possible error codes are listed in Table 9-9.

Table 9-9. API error codes

Error code

Description

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.

200

The application does not have permission to operate on the passed-in uid parameter.

Discussion

The long, long list of Facebook error codes can be found at http://wiki.developers.facebook.com/index.php/Error_codes.

If you’re getting an error and are having trouble tracking it down in the context of your code, try extracting the call and running it directly inside the API Test Console found at http://developers.facebook.com/tools.php?api.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.