My API calls don’t work! I’m getting errors back!
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
An unknown error occurred. Please resubmit the request.
The service is not available at this time.
The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed.
The request came from a remote address not allowed by this application.
One of the parameters specified was missing or invalid.
The API key submitted is not associated with any known application.
The session key was improperly submitted or has reached its timeout. Direct the user to log in again to obtain another key.
The application does
not have permission to operate on the passed-in
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.