The API communicates errors through standard HTTP status codes paired with error objects. Generally the following pattern will apply:

2xx

The request was successfully received, understood, and accepted

3xx

Further action needs to be taken by the user agent in order to fulfill the request

4xx

An error in the request. Usually a bad parameter.

5xx

The request is fine, but something is wrong on SmartSurvey’s end.

HTTP STATUS CODES

For examples of most of the known detailed error codes and their accompanying messages, see here.

200success
201created
202accepted
301redirect
400bad_request
401unauthorized
403forbidden
404not_found
415unsupported_media_type
429too_many_requests
500internal_server_error
503unavailable

Here is an example response if the resource is not found:

{
  "status": 404,
  "code": "not_found",
  "message": "Survey with id '123' could not be found."
}