{"messages":[{"text":"The server understood the request but refuses to authorize it.","locale":"en-US"},{"localeOrigin":"REQUEST","text":"The server understood the request but refuses to authorize it"],"detailCode":"403 Forbidden"
After you generate your Personal Access Token (PAT), which includes your Client ID and Secret, you need to generate an access token using those credentials. That access token is then used on API calls. Here is some additional documentation on this. This link points you to the Choose Authorization Grant Flow section, but it sounds like you would want to use Option #2, Authorization Code
Hey Zach,
I do use Client Credentials and get access token.
When I send the access token to the following endpoints I get the error.
I do get some other endpoints with no error - so I can say the access token is approved.
INFO
You can also get a 403 Forbidden response error when you call an API that expects a user, but your authorization grant type lacks a user context. Calling most admin APIs with a CLIENT_CREDENTIAL grant often produces this result.
Just to confirm, it sounds like you’re using client creds generated for an application (Security Settings → API Management) instead of generating a personal access token (PAT) for a user (Preferences → Personal Access Tokens)
Assuming that’s the case, it’s good to know that not all API endpoints support these application client credentials because they have not yet defined scopes to access them.
The easiest way to find out is to click on the Authorization box and see if it has scopes defined. In the case of get-active-campaigns, there are none
However, if you look at the list-accounts endpoint, it specifically lists the scopes required
BUT
e.g: campaigns
Request:
https://{tenant_name}.api.identitynow.com/beta/campaigns?offset=0
The error response:
{"detailCode":"403 Forbidden","trackingId":"4a59625030f14ad88064a3737510e262","messages":[{"locale":"en-US","localeOrigin":"DEFAULT","text":"The server understood the request but refuses to authorize it."},{"locale":"und","localeOrigin":"REQUEST","text":"The server understood the request but refuses to authorize it."}],"causes":[]}