Using Webhooks
Using Webhooks with Aicado's AI Integration Module
Using webhooks, you can enable real-time communication with your app. Aicado sends notifications via webhooks to users who request them. In addition to the standard notifications, users can assign custom parameters to webhooks, allowing you to manage specific types of data that meet your needs. These parameters enable the information sent to Aicado to be directly returned via webhook, which is ideal for tasks like user authentication.
For using webhooks on AI Models, your platform or tech stack must allow webhooks.
Here is how you can enable webhooks on your embeddable AI tool 👇🏻
1. Setting Up Webhooks
Access the Embeddable AI Tool:
Log in to your Aicado account and navigate to your embeddable AI tool on. If you don't create an embeddable AI tool yet, you can visit this page.
Generate & Configure Webhook URL:
Click on the "Features" tab and enable "Webhook" option to generate a unique webhook URL for your embeddable AI tool.
Go to your application's settings or configuration panel.
Copy the generated webhook URL on your application and paste your webhook url on related input at Aicado.
2. Custom Parameters
Define Custom Parameters:
In the embeddable AI tool, you can define custom parameters that will be included in the webhook payload.
These parameters allow you to pass specific data to and from the AI model.
Assign Custom Parameters:
When configuring the webhook, you can assign values to these custom parameters based on the data you want to track or manage.
For example, you can assign parameters like
user_id
,session_id
,timestamp
, or any other relevant data.
Some parameters are restricted from Aicado, you'll not be able to assign this custom parameters: a_id, at, old_id, s, t, audi, sl, raid, u_id, muser.
3. Handling Webhook Events
Receive Webhook Events:
When an AI model is triggered, Aicado will send a POST request to the configured webhook URL with the specified custom parameters and the AI model's response.
Ensure your application can handle incoming POST requests and process the data accordingly.
Process and Store Data:
In your application, create a handler to process the incoming webhook data.
Use the custom parameters to organize and store the data as needed.
For example, you can store responses in a database, trigger specific actions based on the AI model's output, or update user sessions with new information.
Example Use Case
Imagine you have a customer support application that uses Aicado's AI to analyze customer queries and provide automated responses. By setting up a webhook, you can:
Receive Real-Time Responses:
When a customer submits a query, the AI model processes it and sends the response to your application via the webhook.
Track User Sessions:
Use custom parameters like
user_id
andsession_id
to track which user asked the query and update their session with the AI's response.
Store Query Data:
Save the query and response data in your database for future reference or analysis.
By leveraging webhooks and custom parameters, you can create a dynamic and responsive embed with Aicado's AI models, tailored to your specific needs. For further assistance, feel free to contact us.
Last updated