Getting ticket ID from conversations API for ongoing chat
AnsweredWhen a chat comes through the conversations API I would like to update the corresponding ticket with some information while the conversation is going on.
To do this, I would like to extract the Ticket ID via an API so I can use the tickets API to update it.
I know that I can get the chat id with the `raw_id` field in the VisitorChannel object and I can then use that ID to query the /api/v2/chats/<chat_id> endpoint to get `zendesk_ticket_id`. However, it seems that this API only works once the chat has actually ended.
Is there any way to either get the ticket ID directly from the conversations API or another chat API that I can use to fetch data for ongoing chats? I can see the ticket ID in the GUI as an agent, so surely the data is available.
-
Official commentHi Søren,
Thanks for reaching out!
The ticket ID is not available to the Chat Conversions API, however, there are a few different methods you could use to pull the ticket ID - for example, using the Search API with timestamps to pull the most recent ticket via chat, or the Incremental Exports API. If these aren’t suitable for your use-case, let me know and we can take a look in a bit more detail.
I hope this helps! Feel free to reach out with any questions.
Tipene
-
Hi Tipene,
Thanks for the reply. I think the solutions you suggest would run into a lot of trouble with the volume we are seeing, so if there is a way that you could expose the ID to us either via the /api/v2/chats/<chat_id> endpoint or as a field in the VisitorChannel like you included the raw_id at some point (https://zendesk.github.io/conversations-api/visitorchannel.doc.html#L31) it would be amazing.
-
Hi Søren Dahlgaard,
I'll pass this feedback on to the team that take care of this product - I can definitely see the advantage of having this data immediately available via API. I'd also encourage you to create a post in the product feedback section of community for further visibility and input from other community members.
Thanks!
Tipene
-
Tipene Hughes: Thanks for following up. I've added a post on the feedback forum here https://support.zendesk.com/hc/en-us/community/posts/4417217789082-Getting-ticket-ID-from-conversations-API-for-ongoing-chat
Looking forward to a potential solution.
Best,
Søren
Please sign in to leave a comment.
4 Comments