Errors

Explanation

When using the API you might encounter errors. Here is the description of the different errors raised by the API

Error 400

This error occurs when:
  • your JSON is improperly formatted
  • parameters in your JSON do not comply with the API requirements

In the case of an improperly formatted JSON, the error will look like this:

{
    "errors": {"json": "Can't parse request body. Improperly formatted JSON"}
}

In the case of uncompliant parameters in JSON, the error will look like this:

{
    "errors": {
        "json": {
            "name": "is required",
            "email": "must be a valid email",
            "open_hours": {
                "1": "must be a string"
            }
        }
    }
}

In the previous exemple, open_hours is expected to be an array of string. In the response json, the 1 key refers to the index of the value that raised the error in the open_hours array.

Error 401

This error occurs when our application failed to authenticate you (probably because your api key is disabled or you forget to provide it).

The error will look like this:

{
    "errors": {"authentication": "User not authenticated"}
}

Error 403

This error occurs when:
  • you are trying to access a resource you are not allowed to access
  • when you are trying to perform a forbidden action

The error will look like this:

{
    "errors": {"authorization": "Operation not allowed"}
}

Error 404

This error occurs when the resource you are trying to edit/access is not found in our database.

The error will look like this:

{
    "errors": {"resource": "{Resource} matching query does not exist"}
}

Error 500

This error should not happen. If it does, contact Partoo development team to get it fixed.

The error will look like this:

{
    "errors": {"server": "There was an unexpected error"}
}