Status Codes

Every valid HTTP request receives a response that is comprised of three main components:

  • A 3-digit response status code that gives information about the success or failure of the request, the returned content, and other information specific to the request.

(2) The response header(s), which vary by request. These headers contain metadata information about the request, the response, the response data, and/or attributes of the server.

(3) The response body where free-form text information can be returned to the requester in either JSON (default) or XML format and in a standard defined by the application. This is where application-specific data pertaining to representation, success, and errors is returned to the requester.

Comprehensive list of HTTP status codes: https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Lgfapi uses many of the available HTTP response status codes to convey success or failure of the request back to the user. All response status codes fall into 1 of 4 categories:

1xx – Informational

2xx – Success

3xx – Redirection

4xx – Failure

The following is a list of commonly used response status codes for lgfapi:

Status Code Status Message HTTP Method Description
200 Ok HEAD, GET, POST

GET - The request was successful.

HEAD - The resource exists.

POST - Resource exists and/or has been modified.

201 Created POST Resource successfully created.
204 No Content POST The request was successful, but no content is being returned in the response body.
304 Not Modified HEAD The resource has not been updated since the target date-time.
400 Bad Request HEAD, GET, POST Invalid data or request structure.
401 Unauthorized HEAD, GET, POST Invalid login credentials.
403 Forbidden HEAD, GET, POST User lacks permission.
404 Not Found HEAD, GET, POST The resource does not exist.
405 Method Not Allowed - HTTP method is not supported for the requested resource.
409 Conflict HEAD, GET, POST Record Changed - The resource was modified by a concurrent operation before the request could be fulfilled. Try again.
500 Server Error HEAD, GET, POST An unhandled error occurred or the application was unable to formulate a valid response. Please contact support and provide any returned error information.