Errors

ReferralHero uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, an update failed, etc.), and codes in the 5xx range indicate an error with ReferralHero's servers (these are rare).

When a request returns an error we always try to provide a clear explanation of what went wrong. Errors are returned as JSON files and follow the same structure:

{
  status: "error",
  message: "Error explanation" // Eg: "Missing API token"
  code: "error_code" // Eg: no_token
}

Status

Our API raises errors for many reasons and when this happens the "status" attribute will always be "error". We recommend writing code that gracefully handles all possible API exceptions.

Message

A human-readable message providing more details about the error.

Code

The type of error returned. See list of possible errors below:

Last updated