최근 검색


최근 검색 없음

Get a notification once the agent answers a call.



2023년 8월 24일에 게시됨

Hello, I'm building an application on top of the Zendesk talk. I need to get a notification once the agent accepts the call, or when the ticket is created based on the voice channel. Could you please help me with this? I'm using ZAFClient.


0

4

댓글 4개

Thank you very much Tipene, it is precisely what I need 😎

0


Hi Boris,
 
You'd need to have a backend service of some kind to ingest the API call from the webhook. If you want to have it self contained within a ZAF app, here's a basic example that should do what you're looking for:
 
client.on("app.registered", async () => {
// Get ticket data
const ticketData = await client.get("ticket");

// Save new ticket status boolean and channel value to variables
const ticketStatus = ticketData.ticket.isNew;
const ticketChannel = ticketData.ticket.via.channel;

// Check if ticket is new and if it is via the voice channel
ticketStatus == false && ticketChannel == "voice"
? // Create the notification here
console.log("This is a new ticket based on the voice channel!")
: null;
});
 
This is just grabbing the ticket details via the client.get method then comparing the values and printing to console if it is successful. You can add some code in place of the console.log to create the notification type you need. I'd also suggest adding some error handling to catch any issues.
 
I hope this helps! Let me know if you have any questions. 
 
Tipene

1


Thank you Tipene for your response!

Do you know if the JS SDK can receive this event on the client side?

0


Hey Boris,
 
It sounds like this might be a good use case for triggers and webhooks. You can use the trigger to listen for new tickets via the voice channel, then notify a webhook which you can use to make a call to an external API.
 
Let me know if this works!

1


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물