Errors

The following is an example of a JSON error response.

Response Sample

{
    "status": 403,
    "message": "You are not authorized to access the resource.",
    "code": "forbidden",
    "more": null,
    "traceId": "130527090003731-9b30f89c"
}

The following are HTTP statuses, error codes, and descriptions.

HTTP Status Error Code Description
400 bad_request Bad request
400 data_validation_error Data validation error
400 invalid_uri Invalid URL
401 unauthorized Unauthorized
401 no_token A token is required for the current request.
401 token_expired The current token is expired
401 invalid_token The current token is invalid
401 unauthorized_app Unauthorized app
401 no_app_credential The app credentials is required.
403 forbidden The current request is forbidden.
404 resource_not_found The current request resource is not found.
500 internal_server_error An internal server error occurred.
500 connection_failure A server connection error occurred.

EMSE-related errors

EMSE is Civic Platform's Event Manager Scripting Engine that handles before and after transaction events so that custom scripts can implement server-side business logic. A Construct API request (typically a POST, PUT, or DELETE operation) triggers EMSE before and after events that are associated with the underlying Civic Platform transaction.

If a before-event EMSE script is configured on the Civic Platform server and if the script encountered an error, the transaction is cancelled and the Construct API request returns an HTTP status 500.

If an after-event EMSE script is configured on the Civic Platform server, a successful Construct API request with an HTTP status 200 might also return informational, warning, debug, or error messages from the EMSE script. For example, an HTTP status of 200 with a message: "EMSE operation failed." and code:"emse_error" indicates that the Construct API operation was successful but an EMSE script encountered an error. If an API response includes EMSE-related error messages, capture the error message and contact the agency's Accela administrator to resolve the error.