xREL.v3

API: Error Handling - Wiki

Sprache wählen
Board RSS API Status Hilfe Kontakt
Optionen

Artikel: API: Error Handling

API: Error Handling

If the HTTP status code differs from 200 (Success), an error occured. 404 (Not Found) means that you called a non-existing method (check the URL), 500 (Internal Server Error) means that something went wrong on our site (if this error keeps occuring, please contact us!). These errors return no body at all.
All other errors return a body with a fixed structure. If you have requested the json format:
{
  "error_type": "ERROR TYPE",
  "error": "ERROR CODE",
  "error_description": "ERROR DESCR."
}
And if you have requested the xml format:
<error>
  <error_type>ERROR TYPE</error_type>
  <error>ERROR CODE</error>
  <error_description>ERROR DESCR.</error_description>
</error>
  • The error type may be oauth2, if the error occurs whithin the authentication, or api if it is returned from the api method itself.
  • The error code is an unique identifier on what went wrong, see below for examples.
  • The error text is a human readable description on what went wrong. It often has additional details on what went wrong, and helps to understand the (sometimes) ambiguous error code.

OAuth Errors
Contrary to the specification, OAuth errors may be returned as xml if you requested the xml format.
The most common error codes are:
  • invalid_client: The method you requested is only available with authentication. A 401 (Unauthorized) HTTP status code is returned.
  • invalid_request: You have a missing or malformed parameter in your OAuth request. Read the error description and check with the Guide.
  • access_denied: The access token is invalid or expired. Refresh it or request a new one.

A full list of error codes with further explanation may be found in the specification. Please also note the similar error user_required, listed below and returned as an API error.

API Errors
Possible error codes are:
  • invalid_method: Wrong HTTP method used. You may use POST instead of GET, but not the other way around!
  • scope_required: The access token doesn't have the required scope. Request the access tokens with the scope parameter.
  • id_not_found: Item with the provided ID was not found, or ID not provided. Check the description for details. ID in this context might also refer to a dirname!
  • invalid_argument: An argument is invalid (e.g. missing or value not allowed). Check the documentation.
  • user_required: You wanted to call a method that requires a user context, but have used application-based auth (Client Credentials Grant).
  • permission_denied: You do not have the required permissions to do whatever you wanted to do.
  • comment_too_short: Your comment is too short.
  • comment_too_fast: Please wait longer between posting comments.
  • proof_no_new: All provided releases already have a proof picture or you already uploaded a picture that is pending moderation.
  • proof_not_similar: You tried to post the same proof picture to different releases that don't seem to be similar.
  • out_of_bounds: You tried to request something beyond limits. Normally this shouldn't occur (if you are requesting page 4 of a 2-page-result, you will usually get an empty set).
  • internal_error: Something went wrong on our side. If this message keeps popping up, please contact us!

Zuletzt aktualisiert: 29. Jan. 2018, 22:19 Uhr.

Optionen

Artikel bewerten
0/50/50/50/50/50/50/50/50/50/5
Bisher stimmte niemand ab