Data actions - User context

Hello Team! I'm working on implementing a data action to pull the voicemail message media URI, using this API:
/api/v2/voicemail/messages/{messageId}/media. However when used genesys cloud oauth , it errors by saying "message":"This request requires a user context. Client credentials cannot be used for requests to this resource.""

I tried using SAML2 Bearer by creating a new Oauth but how in genesys cloud, would I be generating access_token using the client id and secret key? How would I create a data action to use the above voicemail API? Please advise.

Hi Yadu_Vamsi_Kattamuru,

You need to use the code authorization type grant type for Oauth2

Here's a resource that will help you in setting that up:

Thank you for your reply. I came across this but we are going to use this in a voice application in an inbound flow. I'm having hard time understanding how to account for the redirect URI in this case and as this being an voice application , how would we generate the token , I see in the link you shared to add genesys cloud node package but how does that help for a voice application? It would be great , if you can advise for a voice application on how to use this code authorization grant and generate the access token. Thanks in advance.

Hello, data actions can only be used with client credentials and cannot use API endpoints that require a user context. This is noted here: About the Genesys Cloud data actions integration - Genesys Cloud Resource Center

Important : You cannot use Genesys Cloud data actions to perform actions on conversations, such as transferring, recording, or disconnecting a call. For more information, see Can I use Genesys Cloud data actions to perform actions on conversations?.

1 Like

Thank You Tim! The voicemail Media API documentation is wrongly stating that it works with client credentials but in reality we need to use user context. Updating the API documentation in API explorer would be great.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.