Skip to content
Last updated

Using a Webhook Integration

To call an Agent in AI Agent Foundry, you need to call the Webhook API endpoint from your system.

Set up a Webhook Integration

Set up a Webhook Integration following Creating a Webhook Integration.

To use a Webhook Integration, you must get an Authentication Token and URL.

  1. Navigate to the Webhook panel in the Integration tab.

  1. Click "eye" icon to see the Authentication Token and copy the text starting with "Basic".

  1. Click "copy clipboard" icon in the "Text Generation URL" to copy the URL.

The Text Generation URL is issued for each user prompt set up in the Webhook integration

Call Webhook URL

The client application must call the URL by POST with the parameters you defined in the User prompt. You can get the result object if you specify the “application/json” content type. Following code is an example code to call by CURL.

sample.sh
curl -X POST {Text Generation URL} \
-H "Authorization: {Authentication Token}" \
-H "Content-Type: application/json" \
-d '{"text": "Please calc the percentage of the total number of users who purchased with in recent 2 weeks"}'

This example assumes the User Prompt contains "text" as a parameter in the "User side prompt text" field.

Continue a chat

The client Application can continue an existing chat using the chat id that is returned at the chat initiation. You can find it in the response header as x-chat-id.

sample.sh
curl -X POST POST {Text Generation URL} \
-H "Authorization: {Authentication Token}" \
-H "Content-Type: application/json" \
-H "X-CONTINUE-CHAT-ID: {x-chat-id}" \
-d '{"text": "Please calc the ratio of customers...."}'

Client application can continue a chat multiple times.