2013年7月2日火曜日

Error Codes & Responses for Twitter Developer

HTTP Status Codes
The Twitter API attempts to return appropriate HTTP status codes for every request. It is possible to suppress response codes for the REST API.

CodeTextDescription
200OKSuccess!
304Not ModifiedThere was no new data to return.
400Bad RequestThe request was invalid. An accompanying error message will explain why. This is the status code will be returned during version 1.0 rate limiting. In API v1.1, a request without authentication is considered invalid and you will get this response.
401UnauthorizedAuthentication credentials were missing or incorrect.
403ForbiddenThe request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why. This code is used when requests are being denied due to update limits.
404Not FoundThe URI requested is invalid or the resource requested, such as a user, does not exists. Also returned when the requested format is not supported by the requested method.
406Not AcceptableReturned by the Search API when an invalid format is specified in the request.
410GoneThis resource is gone. Used to indicate that an API endpoint has been turned off. For example: "The Twitter REST API v1 will soon stop functioning. Please migrate to API v1.1."
420Enhance Your CalmReturned by the version 1 Search and Trends APIs when you are being rate limited.
422Unprocessable EntityReturned when an image uploaded to POST account/update_profile_banner is unable to be processed.
429Too Many RequestsReturned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1.
500Internal Server ErrorSomething is broken. Please post to the group so the Twitter team can investigate.
502Bad GatewayTwitter is down or being upgraded.
503Service UnavailableThe Twitter servers are up, but overloaded with requests. Try again later.
504Gateway timeoutThe Twitter servers are up, but the request couldn't be serviced due to some failure within our stack. Try again later.