Get a notification once the agent answers a call.

4 댓글

  • Tipene Hughes
    Zendesk Developer Advocacy
    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
  • Boris Atayan

    Thank you Tipene for your response!

    Do you know if the JS SDK can receive this event on the client side?
    0
  • Tipene Hughes
    Zendesk Developer Advocacy
    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
  • Boris Atayan

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

    0

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

Zendesk 제공