The holidays are here! This time of year, it’s difficult to keep track of who’s…
Display Phone Number Based On Zendesk Availability
Like many tech companies, we work crazy hours and team members often work remotely. Sometimes we’re here early, some nights we work late, and sometimes we’re celebrating a milestone at a favorite Austin spot.
We use live chat on our site to help our customers and a standard feature of these tools is to dynamically show the chat button when your team is logged in and available. Having chat show up dynamically provides a better experience to our customers.
We were curious to see if we could show and hide our phone number in a similar fashion.
One solution you could use is to display the phone number based on the time of day. The code would look something like this:
But what if the team is swamped? It would be great to only show the phone number if someone is on the other end.
Our API call looks something like this:
And the response from Zendesk looks like this:
We cache the response for five minutes to minimize the number of API calls.
For further reading, here are some resources for you to check out:blog comments powered by Disqus