Hey everyone.
I’m building a custom web chat interface that bypasses the standard Messenger widget. We need full control over the UI, so I’m using the Guest API to handle the handshake and message flow directly.
The initial POST /api/v2/conversations/messaging/guest call works fine. I get back a valid conversationId and the guest details look correct. The issue hits when I try to send the first actual message to that conversation.
Here is the payload I’m sending to POST /api/v2/conversations/messaging/messages:
{
"to": [
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "user"
}
],
"text": {
"content": "Hello, I need help with my order."
}
}
The to.id matches the conversationId returned from the guest creation step. I’m using a service account token with messaging:read and messaging:write scopes.
The API responds with a 400 Bad Request. The error body is pretty vague:
{
"errors": [
{
"code": "400",
"message": "Invalid request body"
}
]
}
I’ve double-checked the JSON structure against the docs. It seems right. I’ve also tried sending it with Content-Type: application/json explicitly set. No luck.
Is there a specific header or additional field required for the Guest API that isn’t documented clearly? Or am I missing a step between creating the guest and sending the message? I’ve been staring at this for an hour and the error message isn’t helping much.
Any pointers would be appreciated.