Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  Create Email Conversation through API

    Posted 07-14-2021 03:29
    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
    ------------------------------


  • 2.  RE: Create Email Conversation through API

    Posted 07-14-2021 12:53
    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
    ------------------------------



  • 3.  RE: Create Email Conversation through API

    GENESYS
    Posted 07-15-2021 12:33
    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
    ------------------------------



  • 4.  RE: Create Email Conversation through API

    Posted 07-15-2021 13:33
    Wouldn't that just create an Email in the user's queue and not actually send it?  Seems like the ask might be (correct me if I misunderstood) for an agentless email to be sent.  When is this coming?

    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 5.  RE: Create Email Conversation through API

    GENESYS
    Posted 07-15-2021 16:12

    Yes Robert, you are probably right.  I wasn't thinking that through fully.  Agentless email is probably the better feature.  I know it is on the roadmap for some time this year, but I don't have an exact date.

     

    Jim Crespino
    Sr Director, Developer Evangelism
    T:  +1 785 477 0504

     

    Developer? Have questions? 

    Check out the DevFoundry.

     

    signature_1009912453

    signature_200569363signature_1372209905signature_929599081signature_823073375signature_1154950993signature_724219154

     






  • 6.  RE: Create Email Conversation through API

    Posted 05-13-2022 14:16
    Jim, did we ever around to creating an Agentless Email option though the API?

    ------------------------------
    Chris Martin
    CCS Medical
    ------------------------------



  • 7.  RE: Create Email Conversation through API

    GENESYS
    Posted 05-13-2022 14:51
    Chris Martin, Agentless Email is nearly here.  It is in beta right now and the planned release data, assuming nothing glaring pops up, should be June 22nd.  Here's the API definition in our Preview APIs section on the Genesys Cloud Developer Center: https://developer.genesys.cloud/platform/preview-apis#post-api-v2-conversations-emails-agentless
    ​

    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



  • 8.  RE: Create Email Conversation through API

    Posted 05-13-2022 15:36
    Hi Jim, Thanks for the quick reply!

    ------------------------------
    Chris Martin
    CCS Medical
    ------------------------------



  • 9.  RE: Create Email Conversation through API

    Posted 07-19-2021 17:05
    Match the background color of your webpage and script for a nice seamless look. 

    ------------------------------
    Michael Steinke
    Inflow Communications
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources