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
------------------------------