Troubleshooting the REST API
Issues with authentication
An error 401 indicates that you could not be authenticated by 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 expire only if they are generated from the /api/token endpoint (as opposed to being generated in the user interface). In this case, generate a new one 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.
You cannot generate a token for the System user. The System user cannot be used to access the API by design, which is to encourage more secure use of permissioning in the system. Additionally, if the System user's API token is revealed, there is no way to delete this user.
Issues with connection to the API at all over HTTPS
By default, the REST API is only accessible over HTTPS. However, if you have not configured HTTPS, requests for any endpoint will fail to connect:
curl: (7) couldn't connect to host
Either configure HTTPS or enable API access over HTTP, although HTTP is only recommended for testing.
API request logging
All TMF621 API requests and responses are logged in the 'TMF API Request Log' record definition. The Rest API logs for the TMF request & response are available in Network Service Operations library.
To view API request logs, perform the following steps:
- From the BMC Helix ITSM menu bar, select Application launcher > Innovation Studio.
- Select the Network Service Operations library.
- From Records, select the TMF API Request Log checkbox.
- Select the Edit data button.
A list of TMF API requests and responses is displayed.
Missing custom fields in API response
Issue
Custom fields do not appear in the TMF621 API response.
Resolution
Make sure that the following conditions are true:
- The field is correctly added to the incident mapping JSON.
- The field name and data type match the expected format.
- The mapping has been deployed and activated in the target environment.
- API logs show no validation errors or warnings. These logs, which help identify missing or incorrectly mapped fields, are essential for diagnosing integration issues.
Issues with alarm creation
Issue
Alarm is not linked to the correct CI.
Resolution
Make sure the following conditions are true:
- The ReconciliationIdentity is provided in the request payload.
- The ReconID is valid and present in the CMDB,
Issue
The field probableCause is missing in the incident summary.
Resolution
Make sure the following condition is true:
- probableCause field is passed in the alarm request payload.
If this field is not passed in the alarm request payload, the summary will include the information related to alarmDetails field.
Issue
Alarm creation is failing despite minimal fields
Resolution
Make sure the following conditions are true:
- The sourceSystemId and alarmDetails are present in the request payload.
- The validation rules are correctly configured in the workflow.