Errors

In this guide, we will talk about what happens when something goes wrong while you work with the API. Let's look at some status codes and error types you might encounter.

You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging.


Status Codes

Felloh uses standard HTTP response codes to indicate the success or failure of API requests.

  • Name
    200
    Type
    Description

    OK: The request was successful.

  • Name
    201
    Type
    Description

    Created: The request was successful, and a new resource was created.

  • Name
    204
    Type
    Description

    No Content: The request was successful, but there is no response to send back.

  • Name
    400
    Type
    Description

    Bad Request: The request was invalid, for example, due to missing headers.

  • Name
    401
    Type
    Description

    Unauthorized: An access token wasn't provided, or the provided token was invalid.

  • Name
    403
    Type
    Description

    Forbidden: A valid access token was provided, but it didn't have sufficient permissions.

  • Name
    404
    Type
    Description

    Not Found: The requested resource doesn't exist.

  • Name
    406
    Type
    Description

    Not Acceptable: The response type you requested with your Accept header isn't supported.

  • Name
    422
    Type
    Description

    Unprocessable Entity: A validation error occurred.

  • Name
    429
    Type
    Description

    Too Many Requests: You made too many requests to the API in a short period of time.

  • Name
    500
    Type
    Description

    Internal Server Error: Something went wrong on our side. Contact support or try again later.

  • Name
    502
    Type
    Description

    Bad Gateway: The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.

  • Name
    503
    Type
    Description

    Service Unavailable: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. Try again later.

  • Name
    504
    Type
    Description

    Gateway Timeout: The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. Try again later.

Error Responses

Our API provides detailed information on what exactly went wrong, included in the response body. Every error returned by the API includes:

  • Name
    title
    Type
    Description

    A quick and simple description of what went wrong.

  • Name
    message
    Type
    Description

    A more detailed human-readable description of what went wrong.

  • Name
    documentation_url
    Type
    Description

    A URL pointing to a place in our documentation where you can read about the error.

  • Name
    type
    Type
    Description

    A machine-readable identifier for the general category of error.

  • Name
    code
    Type
    Description

    A machine-readable identifier for this specific error.

<div class="syntax-highlighter"><pre style="color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Courier New&quot;, monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:.5em 0;overflow:auto;background:#1b0f27"><code class="language-json" style="white-space:pre;color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Courier New&quot;, monospace;direction:ltr;text-align:left;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none"><span class="token" style="color:#d4d4d4">{</span><span>
</span><span>  </span><span class="token" style="color:#9cdcfe">&quot;data&quot;</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span class="token" style="color:#d4d4d4">}</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>  </span><span class="token" style="color:#9cdcfe">&quot;errors&quot;</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">[</span><span>
</span><span>    </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span>      </span><span class="token" style="color:#9cdcfe">&quot;title&quot;</span><span class="token" style="color:#d4d4d4">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;Transaction not found&quot;</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>      </span><span class="token" style="color:#9cdcfe">&quot;message&quot;</span><span class="token" style="color:#d4d4d4">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;The transaction id that you are attempting to access does not exist&quot;</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>      </span><span class="token" style="color:#9cdcfe">&quot;documentation_url&quot;</span><span class="token" style="color:#d4d4d4">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;https://developers.felloh.com/transaction&quot;</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>      </span><span class="token" style="color:#9cdcfe">&quot;type&quot;</span><span class="token" style="color:#d4d4d4">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;not_found&quot;</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>      </span><span class="token" style="color:#9cdcfe">&quot;code&quot;</span><span class="token" style="color:#d4d4d4">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;transaction.not_found&quot;</span><span>
</span><span>    </span><span class="token" style="color:#d4d4d4">}</span><span>
</span><span>  </span><span class="token" style="color:#d4d4d4">]</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>  </span><span class="token" style="color:#9cdcfe">&quot;meta&quot;</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#d4d4d4">{</span><span>
</span><span>    </span><span class="token" style="color:#9cdcfe">&quot;request_id&quot;</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#ce9178">&quot;9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d&quot;</span><span class="token" style="color:#d4d4d4">,</span><span>
</span><span>    </span><span class="token" style="color:#9cdcfe">&quot;status&quot;</span><span class="token" style="color:#d4d4d4">:</span><span> </span><span class="token" style="color:#b5cea8">404</span><span>
</span><span>  </span><span class="token" style="color:#d4d4d4">}</span><span>
</span><span></span><span class="token" style="color:#d4d4d4">}</span><span>
</span></code></pre></div>

Error types

Whenever a request is unsuccessful, the Felloh API will return an error response with an error type and message. You can use this information to understand better what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.

Here is a list of two error types supported by the Felloh API — use these to understand what you have done wrong.

  • Name
    not_found
    Type
    Description

    This means that the item you are looking for does not exist

  • Name
    validation_error
    Type
    Description

    This means that the request that you have made is invalid

<div class="syntax-highlighter"><pre style="color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Courier New&quot;, monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:.5em 0;overflow:auto;background:#1b0f27"><code class="language-bash" style="white-space:pre;color:#d4d4d4;font-size:13px;text-shadow:none;font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Courier New&quot;, monospace;direction:ltr;text-align:left;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none"><span class="token" style="color:#d4d4d4">{</span><span>
</span><span>  </span><span class="token" style="color:#ce9178">&quot;title&quot;</span><span class="token" style="color:#4ec9b0">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;Transaction not found&quot;</span><span>,
</span><span>  </span><span class="token" style="color:#ce9178">&quot;message&quot;</span><span class="token" style="color:#4ec9b0">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;The transaction id that you are attempting to access does not exist&quot;</span><span>,
</span><span>  </span><span class="token" style="color:#ce9178">&quot;documentation_url&quot;</span><span class="token" style="color:#4ec9b0">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;https://developers.felloh.com/transaction&quot;</span><span>,
</span><span>  </span><span class="token" style="color:#ce9178">&quot;type&quot;</span><span class="token" style="color:#4ec9b0">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;not_found&quot;</span><span>,
</span><span>  </span><span class="token" style="color:#ce9178">&quot;code&quot;</span><span class="token" style="color:#4ec9b0">:</span><span>  </span><span class="token" style="color:#ce9178">&quot;transaction.not_found&quot;</span><span>
</span><span></span><span class="token" style="color:#d4d4d4">}</span><span>
</span></code></pre></div>