Troubleshooting the REST API
To understand 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 appliance's logs, look at the log file for the REST API subsystem (setting the log level to DEBUG temporarily can be useful).
Also, here are some specific scenarios you might encounter:
I can't connect to the API at all over HTTPS
Configure HTTPS or enable API access over HTTP.
I keep getting 403 Forbidden errors back from the API
This error occurs if you have configured HTTPS and you try to access HTTP. 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.
I keep getting 401 Unauthorized errors back from the API
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/tokenendpoint (as opposed to being generated in the user interface). In this case, you can generate a new one with another call to the same endpoint. If you are using the Swagger UI, the interaction with
/api/tokenis hidden from you, but you can trigger another call to the endpoint by refreshing the Swagger UI and entering your username and password again.
- The user that owns the token has been deactivated or deleted.
Both the new UI and the REST APIs run on Jetty. When you enable Remedy Single Sign On (RSSO), all calls may get directed to RSSO. Similarly, all the REST API calls may also get redirected to RSSO. When this occurs, REST APIs may stop working. To ensure REST API calls are not directed to RSSO, you must perform the following steps:
I cannot send calls to REST APIs after enabling RSSO
Both the new CMDB UI and the REST APIs run on Jetty. When you enable Remedy Single Sign On (RSSO), all calls may get directed to RSSO. Similarly, all the REST API calls may also get redirected to RSSO. When this occurs, REST APIs may stop working. To ensure REST API calls are not directed to RSSO, you must perform the following steps:
- In the server, open the RSSO configuration file named rsso-agent.properties configuration file.
Add to the excluded URL patterns:
/api/jwt/login*The following is an example of the excluded URL patterns in the rsso-agent.properties configuration file.
# Application URL patterns NOT going through RSSO webagent filter excluded-url-pattern=.*\\.xml|.*\\.gif|.*\\.css|.*\\.ico|/shared/config/.*|/WSDL/.*|/shared/error.jsp|/shared/timer/.*|/shared/login_commn.jsp|/shared/view_form.jsp|/shared/ar_url_encoder.jsp|/ThirdPartyJars/.*|/shared/logout.jsp|/shared/doc/.*|/shared/images/.*|/shared/login.jsp|/services/.*|/shared/file_not_found.jsp|/plugins/.*|/shared/wait.jsp|/servlet/GoatConfigServlet|/servlet/ConfigServlet|/shared/HTTPPost.class|/shared/FileUpload.jar|/BackChannel.*|/servlet/LicenseReleaseServlet.*
For more information, see