When dealing with API requests, it is crucial to be familiar with various status codes. Without a clear understanding of these codes, identifying issues in your API request and resolving them becomes challenging.
The below table describes the status codes that you may find while making API calls,
Status Type | Status Code | Meaning |
---|---|---|
Informational | 100 | Continue |
Informational | 101 | Switching Protocols |
Success | 200 | OK (Standard response for successful HTTP requests) |
Success | 201 | Created (The request has been fulfilled, resulting in the creation of a new resource) |
Success | 204 | No Content (The server successfully processed the request but does not need to return an entity body) |
Redirection | 301 | Moved Permanently (The requested resource has been permanently moved to another location) |
Redirection | 302 | Found (The requested resource has been temporarily moved to another location) |
Redirection | 304 | Not Modified (Indicates that the resource has not been modified since the version specified by the request headers) |
Client Error | 400 | Bad Request (The server cannot or will not process the request due to a client error) |
Client Error | 401 | Unauthorized (Similar to 403 Forbidden, but specifically for authentication) |
Client Error | 403 | Forbidden (The client does not have the necessary permission) |
Server Error | 500 | Internal Server Error (A generic error message returned when an unexpected condition was encountered) |
Server Error | 502 | Bad Gateway (The server, while acting as a gateway or proxy, received an invalid response from an inbound server) |
Server Error | 503 | Service Unavailable (The server is not ready to handle the request) |