Response Codes

5 minute read

The ServiceChannel API returns conventional HTTP status codes as well as body-based error messages.

HTTP Status Codes

Usually, 200 or 201 status codes mark a successful request, 4xx codes indicate that there is an error in the request itself, while codes in the 5xx range state that something went wrong on the ServiceChannel end.

The tables below describe HTTP codes that you may receive.

1xx Informational

Code Text Description
100 Continue The server has received the request headers. You can send the request body.
101 Switching Protocols The server is changing to the protocol specified in the Upgrade header.

2xx Success

Code Text Description
200 OK The request was successful.
201 Created The request was successful, and a new resource was created.
202 Accepted The request has been accepted, but not yet processed.
203 Non-Authoritative Information The request was successful, but the response data may be from a third party.
204 No Content The request was successful, but there is no need to return any data.
205 Reset Content The request was successful, but the server returned no data. Reset the document view to continue.
206 Partial Content The server has returned only part of the resource due to the range request header.

3xx Redirection

Code Text Description
300 Multiple Choices The request has more than one representation options, for example, different file formats. Select a preferred representation and redirect your request to the representation location.
301 Moved Permanently The resource you requested has been permanently moved to a new location. Direct this and all future requests to the URI specified in the Location response header.
302 Found The resource you requested has been temporarily moved to a new location. Direct this request to the temporary URI specified in the Location response header, but continue using the original URI for future requests.
303 See Other You can find the response to your request under another URI. Send a GET request to the URI specified in the Location response header.
304 Not Modified The resource has not been modified since last requested, so there is no new data to return.
305 Use Proxy Access the requested resource through the proxy provided in the Location response header.
307 Temporary Redirect The resource you requested has been temporarily moved to a new location. Direct this request to the temporary URI specified in the Location response header, but continue using the original URI for future requests. In contrast to 302, you cannot change the request method when reissuing the original request.

4xx Client Error

Code Text Description
400 Bad Request The request was not accepted due to bad syntax, missing parameters, insufficient data, etc.
401 Unauthorized Missing or incorrect authentication credentials.
403 Forbidden You are not authorized to request this resource, or the resource is unavailable for some reason.
404 Not Found The request URI is incorrect, or the resource does not exist.
405 Method Not Allowed You have used an incorrect request method. The Allow response header specifies methods supported by this resource.
406 Not Acceptable The format specified in the Accept header is not supported. Usually, the possible format is JSON. See Output Formats for details.
407 Proxy Authentication Required Authenticate yourself with the proxy, and then repeat the request adding a suitable Proxy-Authorization header.
408 Request Timeout The server has timed out while waiting for the request. You can repeat the request without modifications at any later time.
409 Conflict The server was not able to process the request because of a conflict. Study the response body to recognize the source of the problem. Resolve the conflict and reissue the request.
410 Gone The resource you requested is no longer available. Do not request this resource again in the future.
411 Length Required You have not stated the length of the content, which is required by the server. Add a valid Content-Length header and repeat the request.
412 Precondition Failed The server could not meet one or more of the preconditions stated in the request headers.
413 Request Entity Too Large The request is larger than the server is willing or able to process.
414 Request-URI Too Long The URI provided is longer than the server is willing or able to interpret. You have probably used too many query-strings in a GET request. In this case, try to convert it into a POST request.
415 Unsupported Media Type The request contains a media type that the server or resource does not support.
416 Requested Range Not Satisfiable The server cannot provide the portion of the data that you specified in the Range request header. It is possible that the range is outside the size of the target data.
417 Expectation Failed The server could not meet the expectation stated in the Expect request header.
426 Upgrade Required Switch to a protocol stated in the Upgrade header and repeat the request.

5xx Server Error

Code Text Description
500 Internal Server Error Something went wrong, and the server was unable to complete your request. Should this problem persists, click Help in the lower right corner of your screen and submit a bug report.
501 Not Implemented The server cannot fulfill the request or does not recognize the request method.
502 Bad Gateway The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
503 Service Unavailable The server is currently unavailable, or you have reached the throttling limit.
504 Gateway Timeout The server, while acting as a gateway or proxy, has waited too long for a response from the upstream server.
505 HTTP Version Not Supported The server does not support the HTTP version used in the request.

Body-Based Error Messages

While HTTP codes describe the overall situation with the response, the body-based error messages provide more details about the problem. In addition to the descriptive text, error messages contain machine-parsable codes. While we may change the descriptive text, the codes stay the same.

The ServiceChannel API returns error messages in the response body. For example, an error message might look like this:

{
  "ErrorCodes": [
    917
  ],
  "ErrorCode": 917,
  "ErrorMessage": "Invalid Tracking Number"
}

When you get a response, carefully examine both the HTTP status code and body-based error message to find the best solution to a problem.

Error codes and messages vary depending on the endpoint, so check API Reference.

Updated: