How do I correctly to implement the guest api for sending messages without the messenger widget while ensuring my pagerduty integration receives the events immediately?
i am building a custom chat interface that bypasses the standard widget. i use the /api/v2/conversations/messages endpoint to send messages on behalf of the guest. here is the payload structure i am using:
{
"to": [{ "id": "my-queue-id" }],
"body": "urgent help needed",
"type": "text"
}
the issue is that my pagerduty integration relies on the conversation:updated webhook event to trigger sla breaches. when i send messages via the guest api directly, the webhook fires, but the data object often lacks the messages array details i need for incident deduplication logic in my node.js service.
i noticed that if i wait for the standard widget to load, the events are richer. is there a specific query parameter i need to add to the guest api call to force full message metadata in the webhook? or should i be polling the /api/v2/conversations/{id}/messages endpoint instead? i need this to work in real-time for my saopaulo timezone users who hit high load during peak hours. any code examples on handling this latency would be appreciated.