The Make API call step allows you to configure an API call out to another system, such as an internal CRM or ERP, or to push conversation details to an external endpoint, like Amazon Event Bridge or Google Analytics.
In this article, we’ll walk you through the procedures involved in including and configuring the step in a bot flow.
For an overview of the Make API call step and its configuration rules, see Understanding bot step types: Make API call.
This article includes the following sections:
Adding a Make API call step to your bot
Adding the Make API call step to your bot includes a number of distinct tasks.
The procedures below assume you have already created a bot flow, and are adding this step to that bot.
To add a Make API call step
- Open the bot in Flow Builder.
- Click the Add new icon where you want to insert the step, either at the end of a branch, or between two existing steps.
- In the Configuration panel, click Make API call.
- Enter descriptive information for the step. Note that this is
visible to your team – customers will not see the information entered
here:
- Name: A name for the call that makes it easy for your team to identify.
- Description (optional): A short description of the action taken by the call.
- Continue with the procedure described in Adding API details, below.
Adding API details
Use the API details section to configure the HTTP call you want to make including the HTTP request method, location of the external resource, and adding headers if needed. The steps below are a continuation of the procedure in the previous section.
To add the API details
- In the Configuration panel, click API details.
- Use the dropdown to select a Request method:
- GET retrieves data from a server at the external resource. This is the most commonly used method.
- POST sends data to create or update a resource at an external system. If the resource already exists, the data sent modifies the resource.
- PUT sends data to update or create a resource. If the resource already exists, the data sent replaces the resource.
- PATCH sends data to update a resource at an external site. It is used to apply partial modifications to the resource.
- DELETE removes the resource at the external location.
- Enter an Endpoint URL. The endpoint URL is the location of the external
resource you are connecting to. The endpoint URL supports
https://
protocol. You can include variables in the URL 's path or query string values. For more information, see Passing variables in an API call. - Optionally, select a connection to authenticate the API call.Note: You must create a connection before using it in the Make API call step.
- If needed, enter the key and value for an optional header.Important: Don't use headers for authentication. Use API connections instead.
Make API call steps that include an authentication-related header, such as
authorization
orx-api-key
, automatically fail. If a Make API call step fails, the conversation follows the step's API call failed branch. - Click Make API Call to test the API call. If variables are added to the step's URL or header, you can include optional test data to your external service to check if the API call is working as expected. Note this will make an HTTP request to the configured endpoint URL.
Passing variables in an API call
When you enter an Endpoint URL for an API call, you can include variables in the URL's path or query string values. This lets you pass data from the conversation to the external system.
For example, a messaging bot can prompt a customer to provide an order number using an Ask for details step. The bot can then use a Make API call step get the shipping status for the order from your online store.
You can't use variables in the domain or subdomain of an endpoint URL. The following table includes examples of valid and invalid Endpoint URL values.
Valid Endpoint URL | Invalid Endpoint URL |
---|---|
https://myshopify.com/admin/api/orders/order_number.json Retrieve an order by specifying the order ID from Shopify. ![]() |
Variables can’t be added to domain/subdomain |
Retrieve a location by keyword searches from Google’s places API. |
Variables can’t be added to query string key |
If a variable is invalid or empty, the bot skips the variable during a conversation.
Saving variables from the API response
After configuring details and testing the API call, you can save values from the API call's JSON response as variables. You can save up to eight variables in a Make API call step.
To create a variable from the Response data
- In the Configuration panel, click Make API call.
- Expand the accordion and identify the data from external system that you want to
turn into a variable.Tip: Switch to the Response body tab to view the raw response that has came back from the external system.
- Click Save.
- Give the new variable a name. Variable names must include only lowercase letters, numbers, and underscores.
About the step branches
The Make API call step is a branching step. Adding this step splits the bot responses depending on whether API was successfully executed.
At bot run time, any 200 response codes will have the bot moving down the successful branch. All 400 or 500 response codes will have the bot moving down the failed branch. If the API returned 200 with an empty response, any variables saved from this step will be skipped during a conversation.
45 Comments
What is the GET API request that we can make to know from the start (if the user is logged in) who he is and then use the info to speak with him or make API calls please
🙏🙏🙏
How come this is nowhere 😢😢😢
Hey Raphaël Péguet - Officers.fr,
Here's a link which goes in to detail on how to identify end users through end-user authentication:
https://support.zendesk.com/hc/en-us/articles/4411666638746-Authenticating-end-users-in-messaging-for-the-Web-Widget-and-mobile-SDK
Let me know if this is what you're looking for, and if you have any questions!
Tipene
Tipene Hughes thanks a lot for this, but my question was how to then use this info we got by authentification to make API calls in the flow builder like: search the requester e-mail address in shopify (just like we can do it if the requester fills a field during the flow builder).
When the requester fills the flow buiilder field we get a placeholder: {{sf.requester.email}} that we can use to make API calls.
I am wondering if this placeholder is usable if we authenticate user via the way you send
Best regards!
Is there a way for this to allow the bot to submit a request like a regular ticket?
Hi Shiyu Zhu, any update with external_id?
Hi Aron Diploma, external_id is planned for end Q1 23 release.
Raphaël Péguet - Officers.fr, authenticated user email variable is also planned for end Q1 23 release
Hello .
In flow builder connect to my whatsapp number, How can send in an api call the whatsapp number of my requester?
As discussed on the ticket you have submitted, this option is not yet available.
Our user base is sorted based on the priority, can the API call check the priority of the user and direct them to a different bot flow, or block the contact live agent feature? (we let the urgent users to contact agents and for free users direct them to the center?)
I am currently working on including an external API(ChatGPT) into our bot. I am trying to do a POST request, but having "Request Taking Too Long" troubles .
Can I setting the time out boundary in Zendesk call API?
Hey Carlton Kirk,
Alongside with exposing external_id, we are also exposing end-users email and name, does those attributes help you at all in identifying the user?
Song Chen Our current timeline is 10 seconds and there is no ability to customize this right now.
Could you please elaborate what is the use case you are trying to achieve with ChatGPT? Thanks
Greetings, I have Shipstation App linked to Support. I would like to use the bot Flowbuilder to allow people to check the status of their order (shipped, accepted, tracking #, ec.)
Is this where I do it and how would I program it? Thanks for any help!
You can check the option in Using the Make API call step in Flow Builder. Please take note that customization is not part of Zendesk's scope.
The step above is only possible if Shipstation has API endpoints where you can make the calls.
Hi Dane,
The company sent me this link to everything, so I'm assuming I can do all of it? Would you mind seeing if it's possible?
https://www.shipstation.com/docs/api/orders/get-order/
Please sign in to leave a comment.