Does anyone know why typing indicators and read receipts are failing to persist when sent via the Web Messaging Guest API using PowerShell?
I am building a custom internal dashboard for our support team that mimics the web client experience. I successfully established the WebSocket connection using the guest token and can send/receive standard messages without issue. However, when I attempt to send typing events or mark messages as read, the remote party does not receive the updates.
My script uses Invoke-RestMethod for initial token acquisition and a persistent System.Net.WebSockets.ClientWebSocket for the connection. I am constructing the JSON payload manually based on the API docs.
Here is the JSON payload I am sending for a typing indicator:
{
"type": "typing",
"conversationId": "conv_12345",
"guestId": "guest_67890",
"isTyping": true
}
And for read receipts:
{
"type": "read",
"conversationId": "conv_12345",
"messageId": "msg_abc123"
}
The WebSocket does not return an error. The connection remains open, and I receive the acknowledgment frame. But the status never updates in the UI or via API polling.
I have verified the conversationId and guestId match the active session. I am running this on Windows Server 2019 with PowerShell 7.4. The timezone is Australia/Sydney, but that should not affect the WebSocket protocol.
I suspect the type field might need a specific prefix or the payload structure for Guest API differs from the standard Chat API. The documentation is sparse on non-message event types for guests.
Has anyone successfully implemented these specific events in PowerShell? Am I missing a header or a specific JSON property?
Thanks for the help.