In this workflow, you'll learn how to create a conditional flow based on agent availability to check if a message was received when agents were offline. While the bot builder can verify if a message arrived during business hours, it doesn't automatically detect agent availability. To achieve this, you'll need a custom solution with some additional configuration.
The workflow includes the steps below.
- Step 1: Create a bearer token
- Step 2: Create an API connection
- Step 3: Create a conditional statement in the bot builder
Step 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.
Step 2: Create an API connection
Create an API connection by following these steps:
- Select the option Bearer token and enter the token created in step 1.
- Enter the allowed domain value:
rtm.zopim.com
Step 3: Create a conditional statement in the bot builder
- In Admin Center, navigate to AI agents automation > Conversation bots 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.
Note: The real-time API used above is available to Enterprise plans.
9 comments
James
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.
1
Jupete Manitas
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?
1
James
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?
0
Julian Taborda
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.
0
Brett Bowser
0
Ben Chapman
Hey Karun,
I'm trying to follow this, but the items you point out in Step 2 don't appear to exist.
0
Dane
This is for Step 2.
0
Ben Chapman
Hi Dane,
This was super helpful, but now i'm in another situation with multiple Departments using chat in my Enterprise MultiBrand instance; and this solution doesn't work; as if anyone is on in any department, it will allow chats to come through everywhere.
I know there's an API configuration to test for departments, but
Any help is greatly appreciated!
0
Destiny
I'm under the impression that for each of your brand's chats, you're using separate bots to direct the conversation to the appropriate departments, correct? Typically, with such an arrangement, you can add a step to verify the schedules of your accounts or departments. Add business hours condition
Should you need to determine department availability, the relevant API and custom code would apply only to the Classic widget, enabling you to configure the Web Widget (Classic) to show Chat on your webpage only when a certain department is online - Can I configure the Web Widget (Classic) to present Chat on my webpage only when a specific department is online.
However, if your setup utilizes the Messaging widget with a bot, the aforementioned script will not be compatible.
0