When 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.
I’m not aware of any updates to the APIs that would have provided a solution for this use case, and as noted in the feedback post Søren created, the Chat Conversations API is in maintenance mode with no new features to be released past security updates.
That said, I’ve been looking at different ways we might be able to approach this and creating a lightweight Zendesk Apps Framework (ZAF) app could be an option. Creating an app in the Ticket sidebar location gives you access to the ticket object which has many different properties that will be useful, including
ticket.idandticket.requester. You can then manipulate the data as required, and send the data in API requests or using ZAF setter methods for certain properties.Here’s a link to the getting started guide for building apps using the Zendesk Apps Framework, as well as the API reference documentation:
https://developer.zendesk.com/documentation/apps/app-developer-guide/getting_started/
https://developer.zendesk.com/api-reference/apps/introduction/
Feel free to reach out if you have any questions!
Tipene