Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Send Automated Greeting Message in an existing conversation in Web Messenger

    Posted yesterday

    Problem Statement: I would like to send an automated greeting message to customer as soon as the agent joins the chat, just before starting a communication with a customer. As I know there is OOB feature to do this, I am trying to achieve this with different approaches. Hence, I need one assistance from you.

    Approach: 

    • Trigger a workflow on event "v2.detail.events.conversation.{id}.user.start".
    • In the workflow, I want to send the outbound message with the API /api/v2/conversations/messages/{conversationId}/communications/{communicationId}/messages. I initiated a test chat, accepted it and tried this API to send the message from API Explorer. It worked as per expectation. But when I tried to do the same with a Data Action it is throwing below error.

    Error Details: 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":"bad.request","status":400,"contextId":"d1d186e9-e347-4cb3-afba-d2435d987d23","details":[],"errors":[]} [214e64f2-078d-4c13-bc97-3985f4ec4ce8]

    Please suggest some way to solve the problem.


    #Architect
    #DataActions
    #PlatformAPI
    #Triggers
    #WebMessaging

    ------------------------------
    Subhajit Podder
    NA
    ------------------------------


  • 2.  RE: Send Automated Greeting Message in an existing conversation in Web Messenger

    Posted 16 hours ago

    Hello,

    You can't send messages via Data Actions since they require user context.

    You would need to create a webapp (embedded into a script or as a widget) that logins as the agent which can then send a greeting message when the agent answers.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 3.  RE: Send Automated Greeting Message in an existing conversation in Web Messenger

    Posted 13 hours ago

    Hi Jan,

    I am thinking whether it is possible to send the message from Embedded Framework where agents take chat/call. With that user's credential if we call the API to send message in that session it would be resolved. Is it possible?

    Regards,

    Subhajit Podder



    ------------------------------
    Subhajit Podder
    NA
    ------------------------------



  • 4.  RE: Send Automated Greeting Message in an existing conversation in Web Messenger

    Posted 11 hours ago

    If you're using your own developed Embedded Framework application then you could use Javascript SDK to send the message using the Oauth token you've configured in the framework.js file.

    You could even have it automatically trigger when it gets the event that a message interaction has been answered.

    Don't know if the same is possible if you're using an AppFoundry app that uses Embedded Framework.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------