Insert a message via the API into a web messaging session

Hi there,
i have previously used the platform API to insert messages into a webchat session (conversationsApi.postConversationsChatCommunicationMessages). This works well with client credentials (no user context is required) which makes it relatively easy to use.
Now I wanted to implement the same functionality with web messaging and I found this API command for this: conversationsApi.postConversationsMessageCommunicationMessages
However, I get a rejection when I run it with a live web message
"This request requires a user context. Client credentials cannot be used for requests to this resource."

Is this the right API to insert a message into web messaging? Is there a reason it requires a user context? It makes things a lot more complicated if the user must authenticate just to insert specific messages into the session.
Thanks,
Zsolt

Hi :wave:
We'd like to better understand the use-case: can you elaborate more on what you're trying to solve?

Thanks!

Hi Angelo,
we are developing a script to monitor web messages and insert specific messages into the the conversation when necessary from the script (that is, neither the customer nor the agent) which are visible to all parties. One use case would be to insert a message when the agent becomes offline (such as a power outage at the agent site). This is so the customer knows what happened (and we can also inform the customer if we are going to take the web message session back from the agent into the queue.
You can think of this like what we can also do in the Architect flows to welcome the customer or announce EWT before routing to an agent. With web chat this is easy as there is no user context, not sure why web messaging is different here.
thanks,
Zsolt

Hi Zsolt,
Indeed, Web Messaging is built upon the Messaging Platform, which is also powering the other messaging channels from Genesys Cloud, so the API behavior is different from Chat. At the moment the Public APIs exposed by Messaging Platform do require a user context. The only exception would be Agentless Outbound Messages APIs: /api/v2/conversations/messages/agentless, although this is supported only with sms, whatsapp, open, so not available with Web Messaging yet.
This doesn't solve your use-case today, but at least you see where we are. We do want to make Web Messaging behave as an Outbound channel, including Agentless, but this is not planned in the short-term.

Ok, thanks for confirming. I thought this is the case but wanted to make sure there aren't any other APIs we can use without a user context (inserted a mesage into web messaging).
Zsolt