Trying to send a proactive notification to a customer who had a web messaging session last week. We store the conversation ID and user ID in our CRM. Now we want to push a follow-up message from our backend service.
The endpoint is POST /api/v2/webmessaging/conversations/{conversationId}/message. We use a service account with webmessaging:conversation:write scope. The token looks good. But we keep getting 401 Unauthorized.
Here is the payload:
{
"type": "text",
"from": {
"id": "system",
"name": "Support Bot"
},
"text": "Hi, just checking in on your previous request."
}
We tried using the same token to GET the conversation details first. That works fine. So the token is valid. But POST fails.
Is the Guest API different for proactive messages? Or does the conversation need to be active? The docs say you can message existing conversations. But maybe “existing” means open?
We tried changing the “from” ID to the actual user ID from the previous session. Same error. 401.
Anyone have a working example of sending a message to a closed or idle web messaging session via the API?