Troubleshooting the REST API
To start understanding errors from the REST API, examine the status code of the response along with the response body if present. If that does not help, and you have access to the server logs, then look at the log file for the REST API subsystem (setting the log level of the package com.bmc.bcan.rest to DEBUG temporarily can be useful).
No response received when a web service request made through a REST client
When you make a web service request through a REST client, the status displays as 0 NO RESPONSE.
Workaround: Access the TrueSight console using a web browser and with the same credentials that you used in the REST client.
After you successfully access the TrueSight console, use the REST client to make the web services request.
I keep getting 401 Unauthorized errors back from the API
This indicates that you could not be authenticated using the token expected in "Authorization" header. This could be for a number of reasons:
- Issue: The "Authorization" request header itself is missing or invalid.
Solution: Make sure it starts with the word Bearer. - Issue: The token is missing from the request header, or is invalid.
Solution: Note that the token may be a negative number, so be sure to include the minus sign. - Issue: The token has expired.
Solution: Try getting a fresh token. If your application runs into this issue frequently, use the GET /token request to keep your token alive. - Issue: The user that owns the token has been deactivated, disabled, or deleted.
Solution: Contact your system administrator to check the status of the user account in TrueSight Server Automation and in any external authentication system.
I am getting the following error when I make a new SOAP or REST API request
This message means that you've established a session using SOAP or REST to run your APIs. However, if you or RBACAdmin has recently changed your password on the Application Server, your current session is no longer valid. For more details, see Changing-passwords.
Solution: Re-establish your session using the new password.
Supported HTTP status codes for REST API
When responding to requests, the REST API uses some of the standard HTTP status codes. The following table provides a summary of the status codes that are returned:
Code | Message | Usage |
---|---|---|
200 | BLPackage created successfully | The operation is successful. |
500 | INTERNAL_SERVER_ERROR | An error has occurred on the server. |
400 | HttpStatus.BAD_REQUEST | The request is invalid. |