One thing that you can do is to create and host a web application, just basic HTML/Javascript, that uses the Javascript Platform SDK and performs an OAuth Implicit Grant flow to authenticate the app as the currently logged in user. The UI of the web app could just contain a single button called "Create Email" and would invoke a function in the javascript that creates the email. You would then embed this web app into an agent script using the Web Control. If you size the web control properly to just show the button in the web app, then you might be able to make it look like a standard button embedded in the agent script.
By doing all of this your web app will authenticate as the logged in user, thus run under an agent context, and will then be able to create the email on behalf of that agent.
Hope that helps.
------------------------------
Jim Crespino
Senior Director, Developer Evangelism
Genesys
https://developer.genesys.com------------------------------
Original Message:
Sent: 07-14-2021 12:53
From: Robert Wakefield-Carl
Subject: Create Email Conversation through API
Some of the API requires user context or system context (as in this one), so it cannot be run in scripts with client credentials. Scripts run ussing system credentials while developer tools uses client credentials.
------------------------------
Robert Wakefield-Carl
Avtex Solutions, LLC
Contact Center Innovation Architect
robertwc@avtex.com
https://www.Avtex.com
https://RobertWC.Blogspot.com
Original Message:
Sent: 07-14-2021 03:29
From: Dennies Salenga
Subject: Create Email Conversation through API
Hello To All Expert,
I would like to ask for some help, I'm trying to create and action under integration which will suppose to create an Email conversation by using the API "/api/v2/conversations/emails". on the Developer Tools everything is working fine however once I try to test it under the action it I am getting an error message {"message":"This request requires a user context. Client credentials cannot be used for requests to this resource.","code":"not.a.user","status":400}. I will be a big help if any of you guys can help me to solve this issue.
Error running action test
8. Execute: The request could not be understood by the server due to malformed syntax.- 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} [8a164582-48c1-4dda-b258-a4f36618620e]
#Integrations
#Outbound
------------------------------
Dennies Salenga
------------------------------