Issue symptoms
How do I create a condition in the bot builder to check when no agents are available?
Resolution steps
The bot builder has a step to check if the message came within or outside business hours, but it doesn't have the option to know if the agents are offline.
Creating a conditional flow based on agent availability and not business hours can be achieved through a custom solution that requires some configuration. This recipe has three major components.
1. Create a bearer token
Create a bearer token for the Zendesk Chat API by following the steps in the article: Chat API tutorial: Generating an OAuth token.
2. Create an API connection
Create an API connection by following the steps provided in the article: Creating API connections for the bot builder.
While creating a connection ensure to complete the following:
- Select the option Bearer token and enter the token created in step 1
- Enter the allowed domain value:
rtm.zopim.com
3. Create a conditional statement in the bot builder
- In Admin Center, navigate to Bots and automation and select your bot.
- Under the selected bot, choose the answer intent.
- Add the HTTP API call step with details:
- GET
- Enter the Endpoint URL: https://rtm.zopim.com/stream/agents/agents_online
- Under Authentication, select the connection created in Step 2.
- Click on Make an API call to test the call and return status code 200.
- Under the Variable tab, select Open content, then Data.
- In Data, you will see agent_online. Click Save adjacent to this and save the variable as is. Zendesk creates a variable as
agent_online
which is utilized in the next step.
- Under API Successful flow, create a conditional step with options Online and Else.
- Open the Conditional step, and under Options configure the option as Online.
- Add the condition:
agent_online IS NOT 0
- Save and publish the bot.
You have successfully created a condition in your bot to check if agents are available.
6 Comments
So we need to hire a developer to address a very simple issue?! A person asking for an agent shouldn't have to end up sitting there waiting indefinitely to be told they can't be served right now and it's unrealistic for some smaller companies to carry out this solution.
We understand that if you feel this is something you have to develop together with a developer or someone who is an API expert. This particular workflow/configuration is case-to-case bases. However, you can use the native business schedule to be applied in the flow steps, where visitors can be notified and see your operating hours when launching your messaging widget. Will the "schedule" option not suffice on your use case at the moment? or in case your department is scheduled online but there is a certain time all agents be invisible?
Jupete Manitas The problem arises if it's during normal business hours and our agents don't want to accept the message, it disappears for them after 10 minutes but for the web visitor they would still be sitting there waiting with no updates to say "Hey... it's been 10 minutes, we can't find an agent, leave a message and we will get back to you..." something like that. What's the workaround?
Hi, I must say that this article needs to be updated. The procedures can be made without developing knowledge, however it takes a lot time for a person like me who has a very basic notion of developing. All this time invested for me and for your support agents just to find out that this solution only works for enterprise accounts. You guys need to be really clear about this stuff, we have upgraded our account 2 times already and still there are features that are unavailable, which is to be honest quite irritating, and we find out that our account doesn't have access to certain features only after having spent hours trying to implement your recommendations.
Hey Karun,
I'm trying to follow this, but the items you point out in Step 2 don't appear to exist.
Please sign in to leave a comment.