Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Latest commit

 

History

History
37 lines (26 loc) · 1.88 KB

errors.mdx

File metadata and controls

37 lines (26 loc) · 1.88 KB
sidebar_position
4

Errors

AniAPI uses conventional HTTP response codes to indicate the success or failure of an API request. As a summary:

  • 2xx range indicates success
  • 4xx range indicates an error regarding the information provided (e.g., a required parameter missing, a resource not found, etc)
  • 5xx range indicates an error with AniAPI's server

:::caution

HTTP errors are returned inside the HTTP response header, instead API errors are returned inside the HTTP response body!

:::

API errors

When an API request gets an HTTP 200 status code as a response, it could mean that the API response contains an error. These are the possible errors you can have:

Status Reason
200 - OK Everything worked as expected
400 - Bad request The request was unacceptable, often due to missing a required parameter
401 - Unauthorized The user is not able to authenticate
403 - Forbidden The user doesn't have permissions to perform the request
404 - Not found The requested resource doesn't exist
429 - Too many requests Too many requests hit the API too quickly from the same origin
500 - Server error Something went wrong on AniAPI's end

Handling errors

We recommend to focus on HTTP errors just for Authentication or network problems.