Newer Version Available

This content describes an older version of this product. View Latest

Status Codes and Error Responses

The response header contains an HTTP status code. If the response isn’t successful, the response body contains an error message accompanying that error, and if appropriate, information about the field or object where the error occurred.
HTTP Status Code Description
200 Success with GET, PATCH, or HEAD request
201 Success with POST request
204 Success with DELETE
400 The request could not be understood, usually because the ID is not valid for the particular resource. For example, if you use a userId where a groupId is required, the request returns 400.
401 The session ID or OAuth token has expired or is invalid, or, if the request is made by a guest user, the resource isn’t accessible to guest users. The response body contains the message and errorCode.
403 The request has been refused. Verify that the context user has the appropriate permissions to access the requested data, or that the context user is not an external user.
404 Either the specified resource was not found, or the resource has been deleted.
409 A conflict has occurred. For example, an attempt was made to update a request to join a group, but that request had already been approved or rejected.
412 A precondition has failed. For example, in a batch request, if haltOnError is true and a subrequest fails, subsequent subrequests return 412.
500 An error has occurred within Force.com, so the request could not be completed. Contact Salesforce Customer Support.
503 Too many requests in an hour.

Example

This request requires a comment ID, but it uses a feed item ID instead:
1GET /chatter/comments/0D5D0000000XZoHKAW
The response body is:
1HTTP/1.1 400 Bad Request
2Date: Fri, 22 May 2015 17:32:10 GMT
3Set-Cookie: BrowserId=D_3feNw7RYmP4DA;Path=/;Domain=.salesforce.com;Expires=Tue, 21-Jul-2015 17:32:10 GMT
4Expires: Thu, 01 Jan 1970 00:00:00 GMT
5Content-Type: application/json;charset=UTF-8
6Transfer-Encoding: chunked
7
8
9[ {
10  "errorCode" : "INVALID_ID_FIELD",
11  "message" : "Invalid identifier: 0D5D0000000XZoHKAW"
12} ]