Skip to main content
A customer calls and asks, “Is product number one in stock?” Connect a product API so your AI assistant can pass the product ID to your system, retrieve inventory, and answer from the result. The video is 2 minutes 35 seconds, with Mandarin narration and Traditional Chinese captions. Follow the English instructions below for the same configuration.

What you will build

  1. The customer provides a product ID, such as 1.
  2. The lookup_product tool sends GET /products/1 to the product system.
  3. The AI receives the product name, price, and stock quantity, then answers the customer.
This example uses the DummyJSON sample product API. Its sample inventory is separate from your store. Replace it with your own API to retrieve your products. Before starting, prepare an AI assistant that will use the tool and an account with integration management permission. Open Settings → Integrations → API tools and data.

1. Create a shared connection

Under Shared connections, click Add connection, enter these values, and save. The connection holds the API address and authentication. If your system requires a credential, select Bearer token or Custom authentication header according to its documentation and enter the credential.

2. Define the lookup tool

Click Add lookup tool and complete the Configuration tab.
  • Tool name: lookup_product
  • Connection: the Product API connection you just created
  • Available to: the assistant handling product questions
  • Enable tool: on
For When to use this tool, enter:

3. Pass the product ID to the API

Open Request parameters, set Request path to /products/{product_id}, and add a parameter. The name inside the braces must match the parameter name. When the customer provides ID 1, the request path becomes /products/1.

4. Choose the fields the AI receives

Under Response data, add these three fields and mark each as required. The left column must match the API’s actual JSON structure. The right column provides names you can reference in the response instructions. If your API nests the title under data.title, use data.title in the left column.

5. Set the response instructions

Enter your service rules in How the AI should use the result, then click Save settings.

6. Run a test lookup

Open Test and preview and enter this in Test input (JSON):
Click Run query and compare Data before field mapping with Data actually sent to AI. The mapped product fields below were returned during filming; use the API’s current response when you test.
When all three fields are correct, the connection, parameters, and mapping work for this lookup. With the sample stock value of 99, the assistant can answer, “There are currently 99 units in stock.” Next, test a conversation with your assistant: it should ask for a missing product ID, call the tool once it has the ID, and answer from the result.

Use your own product system

Ask your API integrator for the base URL, authentication method, request path, and a sample JSON response. Generic lookup tools currently use HTTPS GET. Replace the connection, parameters, and fields above, then test a product from your system. For first-time setup, see Create your first outbound AI agent. For line and availability requirements, see AI voice agents.