Trying to bypass the standard Messenger widget to build a custom UI for a specific client integration. The requirement is to handle the full guest lifecycle via the Guest API (/api/v2/messaging/guests) and the Web Messaging API endpoints directly.
The setup works for creating the guest and the conversation, but when I try to inject the OpenTelemetry trace context into the X-GC-Trace-Id header on the POST /api/v2/messaging/conversations/{conversationId}/events call, the server returns a 400 Bad Request. The response body says Invalid request body.
Here is the payload I’m sending:
{
"type": "message",
"content": "Hello world",
"metadata": {
"otel.traceId": "abc123...",
"otel.spanId": "def456..."
}
}
I’ve tried moving the trace IDs into the headers object of the request instead of the body, but the API doesn’t seem to accept custom headers for this specific endpoint in the same way the REST client does.
Is there a documented way to pass trace context through the Guest API event stream? Or should I be using a different endpoint to ensure the span propagates to the backend Data Actions that trigger on message.created events? The current approach breaks the distributed tracing chain.