The first screenshot is showing a 404 not found error, not an authentication error.
This usually means the URL is wrong, rather than a failed authorization attempt which usually generates a different status code.
You appear to have a request to the token endpoint, plus the authorization helper. You don’t have both, its either a fully fledged request to the token endpoint, or you use the Authorization helper.
Looking at the Precisely API documentation, the URL looks ok.
Generating an OAuth Token (precisely.com)
Are these the instructions you are following? The auth is not using a bearer token. Is using basic auth with a base64 encoded string generated from your API key and secret.
The API also states that the content type is application/x-www-form-urlencoded. Its not a JSON request. In the body the documentation states “grant_type=client_credentials” which doesn’t quite make sense (as that looks like a query parameter). So it looks like a bit of trial and error related to that item may be needed.
I think the request needs to look like the following.
The Authorization is also slightly confusing, as Basic auth is normally a username and password encoded into a Base64 string.
Postman can do this from the authorization helper.
In your case, the Username sounds like it should be the API key and the secret should be the password.
If that doesn’t work, just setup the header manually. It should look something like.
Store the actual Base64 encoded string in an environment variable (so its secure).
If I send using this method with a made up Base64 encoded string. I get the expected 401 Unauthorized status. (Instead of the 404 not found, you are getting).
The issues you are facing are API usage issues. So you’ll have the same issues using Python or any other method.
You need to call the token end point to get an access_token. That access_token is the bearer token for the subsequent requests.
I’m not a developer, but it doesn’t look like precisely is strictly following the OAuth 2.0 implementation rules. So you might need to do this as a full request, as I think the helpers will struggle with the non-standard implementation. Suspect there will be an amount of trial and error here.