Make sure your oauth client is configured as a auth code grant and make sure that the environment variable is set to mypurecloud.com.au (I'm assuming that's your region based on your profile config). Also, keep in mind that OAuth clients do not span regions, so you have to have created it in the same region you're using to log in. Beyond that, inspect the postman page and see if you can get more information from the network requests.
Thanks! Tim. I have set the environment variable now and also changed grant type to client credentials as we have the same settings under Oauth. I could able to access some of the resources API calls.
I have a new issue where i am trying to call using postman and i receive
{"status":403,"code":"not.authorized","message":"You are not authorized to perform the requested action."}
That's a permission related issue. I would check the role you assigned to the OAuth configured in PureCloud. Make sure that the role you assigned has these permissions:
Looks like you have the required permission based on what Tim said. If you are using other endpoints on the API you need to check that you meet those requirements as well, but you should be able to make requests to /api/v2/analytics/conversations/{conversationId}/details
Keep in mind that the request you're making (the one posted above) is using client credentials for authorization. The role assigned to the OAuth client is how permissions will be determined; your user's configuration is irrelevant because your user isn't making that request.
yeah Tim. I understand now. so how can I make a request using client credentials to resolve the error. currently I am getting unauthorized permission. Do I need to switch to authorization code? My only concern is if I change the settings in pure cloud to authorization grant type, it impacts the current apex code as it is using client credentials to make an API Call?