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.
Original Message:
Sent: 01-07-2025 23:24
From: Matsumoto Shun
Subject: Send a message to the user
Thank you for your reply.
Sorry for the elementary question. Which screen are you referring to exactly, the custom code?
------------------------------
Matsumoto Shun
Unknown
------------------------------
Original Message:
Sent: 01-07-2025 09:36
From: Maxim Tsvetov
Subject: Send a message to the user
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
Original Message:
Sent: 01-07-2025 03:33
From: Matsumoto Shun
Subject: Send a message to the user
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
Original Message:
Sent: 12-20-2024 14:52
From: Maxim Tsvetov
Subject: Send a message to the user
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:
- Can only send message to chat group, but not to an individual user
- 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