Skip to content

Instantly share code, notes, and snippets.

@ezhlobo
Last active December 11, 2020 06:38
Show Gist options
  • Save ezhlobo/0c91344084be6d76cf052a54ce8b43fa to your computer and use it in GitHub Desktop.
Save ezhlobo/0c91344084be6d76cf052a54ce8b43fa to your computer and use it in GitHub Desktop.
Type Description Required Keys Optional Keys
success All went well, and (usually) some data was returned. status, payload
fail There was a problem with the data submitted, or some pre-condition of the API call wasn't satisfied status, payload
error An error occurred in processing the request, i.e. an exception was thrown status, message code, payload
{
  "status": "success",
  "payload": {
    "members": [
      { "id": 1, "name": "Eugene" },
      { "id": 2, "name": "Alex" }
    ],
    "meta": {
      "totalPages": 3,
      "totalItems": 5,
      "perPage": 2,
      "currentPage": 1
    }
  }
}
{
  "status": "fail",
  "payload": {
    "title": "Title is required"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment