Need to make a Data Action on for the user, but OAuth client is not a user

Using the Platform API via API Explorer, I'm able to make a call. I need this functionality in an agent script (button that calls Genesys Cloud Data Action). However, when I test the action, I get an error that it isn't in the user context (but when I test it from API Explorer it is). I assume it is because of the OAuth client.

How do I make this Data Action use the user's context/authorization, since it is only the user that will invoke it?

Error messages below:

"message": "The request could not be understood by the server due to malformed syntax.",
"code": "bad.request",
"status": 400,

  "message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: {\"message\":\"This request requires a user context. Client credentials cannot be used for requests to this resource.\",\"code\":\"not.a.user\",\"status\":400,\"

I think I found the answer to my question: it is not possible

Can I use Genesys Cloud data actions to perform actions on conversations? - Genesys Cloud Resource Center (mypurecloud.com)

This isn't possible. Data actions can only use client credentials because there is no user present inside the Genesys Cloud backend services to authorize the request; client credentials are the only option for headless API requests such as data actions. If you need a user context, you must do it from an application that is able to interact with the user via a web browser.

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