We’re trying to inject our OpenTelemetry trace_id into the payload when a user clicks a Quick Reply button in the Web Messaging widget. The goal is to have that ID propagate to a Genesys Cloud Data Action so we can correlate the user interaction with our backend spans.
Here’s the setup. We’re using the Genesys Cloud Web Messaging SDK (genesys-cloud-messaging-sdk) version 2.4.0. On the backend, we have a bot flow that sends a structured message using the Open Messaging API (POST /api/v2/conversations/messaging/messages).
The JSON payload for the message looks like this:
{
"from": {
"id": "bot-id-123"
},
"to": [
{
"id": "user-session-id-456"
}
],
"content": {
"type": "application/vnd.genesis.messaging.quickreply",
"action": "SELECT_OPTION",
"options": [
{
"label": "Check Status",
"value": "check_status",
"metadata": {
"otel_trace_id": "0af7651916cd43dd8448eb211c80319c"
}
},
{
"label": "Cancel Order",
"value": "cancel_order",
"metadata": {
"otel_trace_id": "0af7651916cd43dd8448eb211c80319c"
}
}
]
}
}
The message renders correctly in the widget. The user clicks “Check Status”. The event fires in the client. But when the interaction reaches our Data Action (which is triggered by the bot flow on message_received), the metadata object is empty. The value comes through as “check_status”, but the custom metadata with the trace ID is gone.
I’ve checked the raw webhook payload from Genesys Cloud to our listener endpoint. The metadata field isn’t there. It seems like the Open Messaging API strips custom metadata from Quick Reply options before sending the user’s response back.
Is there a different way to attach context to a Quick Reply that survives the round trip? Or do I need to use a Card message instead? We’ve tried using application/vnd.genesis.messaging.card but the click handler there is even less clear for extracting custom data.
Any code examples of how to pass a trace ID through a Quick Reply click would be helpful.