1. Home
  2. Docs
  3. API
  4. REST API basics
  5. Responses

Responses

The response header will follow the HTTP standard where

200 OK — Request successful

201 Created — Entry created successfully

204 No Content — Request returned no content

400 Bad Request— Problem with your request

401 Unauthorized Problem with the JWT token

403 Forbidden Permission problem

404 Not Found Endpoint non existent

The response body is as follow for valid request:

{
  "status": "success",
  "data": {},
  "messages":[],
  "action":"",
  "ids":[],
  "debug":{}
}

And as follow for errors:

{
  "status": "failure",
  "errors": {},
  "messages" : []
}

Where “status” will either “success” or “failure“.

A successful request will result in a success status obviously, while data will contain the relevant information and some optional supplementary data (messages, ids and/or debug).

For create/update, “ids” will contains the create/updated ids.

messages” : Will contain warnings or relevant non blocking messages.

“debug” : If debug is set in the request, relevant debug information will be here.

See an example

An unsuccessful request will result in a failure while data will contain relevant information about the error.

How can we help?

Leave a Reply