Here are explanations of various status codes you may receive on API responses.
200 - Success
The status code 200 means OK or Successfully your response is ready.
201 - Created
The status code 201 means your request has been created and you'll receive actual response in future responses that are caused by new requests
400 - Bad Request
Invalid Request (JSON) Body
Another reason that may cause this status code, is sending a request with an invalid request body (JSON).
For example, if you forget a comma symbol, or do not close curly braces** etc, they lead to a response with this status code.
Here is an example response with this status code:
{
"message": "Your request is invalid. request body should be a valid json."
}
401 - Unauthorized
The status code 401 means you are not authorized correctly by api-key on request headers. there are different reasons the MagicalAPI API Gateway may send a response with this 401 status code:
- Forgetting to set api-key in the request's headers, and makes this response message:
{
"message": "Authentication Failed."
}
- If you set an invalid api-key also leads to 401 status code:
{
"message": "Unauthorized!"
}