Are you getting an error due to an invalid token when you make an API request?
The API request fails if the token that you use does not have permissions to work with the Activity Tracking service.
Your request fails with an error message that indicates that you are not authorized.
When you are not authorize to complete a task, you get an error in your response:
{"trace":"53b41915-749c-4af2-b61f-22194d3b56ea","errors":[{"code":"invalid_token","message":"You are not authorize to complete this task. Check you have IAM permissions to work with Activity Tracking in the account.","recovery":"After you check you have permissions, run 'ibmcloud login' to log in to IBM Cloud. Then, run ibmcloud iam oauth-tokens to retrieve your access tokens. Use the IAM token for the Authorization header in your request."}
To resolve the problem, complete the following steps:
- Check you have IAM permissions to work with Activity Tracking in the account.
- Get a valid access token. Learn more about retrieving IAM access tokens.
- Retry the request. Pass the IAM token in the Authorization header of your request.