Error handling for the REST API


Supported HTTP status codes

Code

Description

201

Successful update. Includes the Location header set to the URL of the new entry resource.

204 

Successful update. The request was successful, but there is no content to return.

207

Partial Success
Indicates that the incident was successfully created or updated, but one or more associated resources (such as related alarms or impacted services) failed to process.

Error codes

Code

Message

Typical reason

400

Bad Request

The request body is not correct. For example, a JSON document is sent but it is not the correct format or the client sends a date value in the wrong format.

401

Unauthorized

This error indicates that you could not be authenticated using the token expected in the HTTP "Authorization" header. Several reasons could cause this problem:

  • The "Authorization" header itself is missing or invalid.
  • The token is missing from the header or is invalid.
  • The token has expired. Note that tokens only expire if they are generated from the /api/token endpoint (as opposed to being generated in the user interface). In this case, generate a new token with another call to the same endpoint. If you are using the Swagger UI, the interaction with /api/token is hidden from you. To trigger another call to the endpoint, refresh the Swagger UI and enter your username and password again.
  • The user that owns the token has been deactivated or deleted.

403

Permission denied

This problem could occur for several reasons.

If you are trying to access the REST API over HTTP, you will receive a 403 error if HTTP access is currently not allowed. BMC Helix does not recommend access to the API over HTTP, but if you do want to enable it for testing purposes, go to the HTTPS Configuration page in the user interface.

If your HTTP(S) configuration is correct, but you still receive 403 errors, the user accessing the API might not have permission to perform the actions required by the endpoint. Some endpoints require more permissions than others.

If you can access some endpoints successfully, your problem is likely to be a lack of permissions. If all endpoints are returning a 403 error, your user might not have permission to access the REST API at all.

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*