Dailys
Docs

Response Types

This section details the different response types that dailys API might return when interacting with the API. Some of these requests can give a good indication if there is a problem with interacting with the API. If you are getting any responses that are not detailed in this documentation, please feel free to contact our support team.

Bad Request (400)

The bad request response is returned when a logic error has occurred, which is typically when the action would not make sense or if there is a system limitation. For example, if a user attempts to delete their own account using the API route.

{
  "success": false,
  "code": 400,
  "message": "Bad Request",
  "errors": [
    "..."
  ]
}

Unauthorised (401)

The unauthorised response indicates that you have used the API route correctly, but your account / user does not have sufficient level of privilege to access this information.

{
  "success": false,
  "code": 401,
  "message": "Unauthorised",
  "errors": [
    "You are not permitted to perform this action."
  ]
}

Unauthenticated (403)

The unauthenticated response indicates that there is an issue with the client credentials being used to make the request. It is most likely that the request has been miss-formed. An example of the 403 response is is shown below:

{
  "success": false,
  "code": 403,
  "message": "Unauthenticated",
  "errors": [
    "Authentication is required for this request."
  ]
}

Not Found (404)

The not found response indicates that the API route you are attempting to access does not exist, and could be the result of a spelling mistake within the resource URI.

{
  "success": false,
  "code": 404,
  "message": "Resource Not Found",
  "errors": [
    "Cannot find requested resource, please try again."
  ]
}

Method Not Allowed (405)

The method not allowed response indicates that the HTTP Request used for the API route is not the correct method. An example of this would be making a POST request on a GET API route.

{
  "success": false,
  "code": 405,
  "message": "Method Not Allowed",
  "errors": [
    "Check your HTTP request method, and try again."
  ]
}

Input Validation Failed (422)

The unprocessable entity response indicates that the request input has failed validation, which can (generally) mean that there are some missing fields for the data. A collection of error messages will be passed as JSON object in the response.

{
  "success": false,
  "code": 422,
  "message": "Input Validation Failed",
  "errors": {
    "code": [
      "The code is required."
    ]
  }
}