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.