Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Send a message to the user

    Posted 12-20-2024 03:50

    Hello everyone

    I would like to use this API to send messages to users.

    "POST /api/v2/chats/users/{userId}/messages"

    I have configured this API to be requested using Genesys Cloud Data Actions, but it is not working.

    Please advise what kind of data action configuration is desirable to make this API work.

    * As a premise, it is assumed that the value of the user ID is stored in the variable Flow.userid on the architect side


    I would like to know about the contract and request in particular.


    #API/Integrations

    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------


  • 2.  RE: Send a message to the user
    Best Answer

    GENESYS
    Posted 30 days ago
    Edited by Jason Kleitz 30 days ago

    Hi Matsumoto,

    API-related questions should be asked on the Developer Forum: https://developer.genesys.cloud/forum/

    However, the Collaborate Chat API cannot be used within Data Actions because it requires user context, and Data Actions use OAuth client credentials. Here's a link to a discussion thread that explains this limitation: https://developer.genesys.cloud/forum/t/collaborate-chat-api-using-data-action/27553/8

    Alternative options:

    1. Send an email message using Agentless API  https://help.mypurecloud.com/articles/agentless-email-notifications/

    2. Send an email by using  custom SMTP integration https://help.mypurecloud.com/articles/use-the-custom-smtp-server-integration-to-send-outbound-emails/

    3. Send an email message using the Send Notification action inside Workflows.

    If you decide to use Send Notification, you would need to do it in two steps:

    • Step 1: Create a Workflow that uses the Send Notification action to send email to a user. 
    • Step 2: Create a data action that calls your Workflow

    4. Send message to a group using Generic Chat notifications via Webhook: https://help.mypurecloud.com/articles/set-up-an-integration-using-the-generic-webhook

    This method has some limitations:

    1. Can only send message to chat group, but not to an individual user
    2. Not supported in ORGs with SSO-only authentication

    5. If you really need to send a message (not an email), you can wrap the "POST /api/v2/chats/users/{userId}/messages" request inside an AWS Lambda function authenticated with the user's account.

    6. You can also try using new Genesys Cloud Functions (currently in BETA) - these are basically the same as AWS Lambda functions but hosted on the AWS Genesys account: https://community.genesys.com/communities/genesys-cloud-beta-hq/beta-board

    I hope this helps!



    ------------------------------
    Maxim Tsvetov
    Principal PS Consultant
    Genesys
    ------------------------------



  • 3.  RE: Send a message to the user

    Posted 13 days ago
    Hi Maxim
     
    Sorry for the late reply.
     
    I would like to use this API in a script to send a message to the user in charge.
     
    Since it cannot be used within a data action, I am thinking of calling the API directly on the script side without using a data action.
     
    Is this possible? If possible, I'd like a simple way to do it.


    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 4.  RE: Send a message to the user

    GENESYS
    Posted 12 days ago

    Yes, you can use Collaborate Chat API directly inside your custom code

    https://developer.genesys.cloud/commdigital/collabchat/chat-apis



    ------------------------------
    Maxim Tsvetov
    Principal PS Consultant
    Genesys
    ------------------------------



  • 5.  RE: Send a message to the user

    Posted 12 days ago
    Thank you for your reply.
     
    Sorry for the elementary question. Which screen are you referring to exactly, the custom code?


    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 6.  RE: Send a message to the user

    GENESYS
    Posted 11 days ago

    You mentioned script in your previous message. It cannot be script inside Genesys Cloud since scripts require data actions to use API.

    But it can be custom web-interface that uses API directly and has a context of user.



    ------------------------------
    Maxim Tsvetov
    Principal PS Consultant
    Genesys
    ------------------------------



Need Help finding something?

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