Custom API Action
The Custom API Action allows your AI agent in Social Intents to query external APIs and display the result directly within the conversation. This enables real-time lookups, updates, or actions triggered by the user, such as checking order status, pulling in account data, or submitting a form.
General
- Action Name: Provide a descriptive name like
get_weather
orupgrade_subscription
. - When to use: Describe when this API action should be triggered. Include sample phrases the AI should recognize and what type of information the API provides in response.
API Configuration
- Action Type: Call API Request
- Action Name: A descriptive name like get_weather
- When to use: Example: “This action is triggered when a visitor asks for the weather in any city.”
- Triggered response: Example: “Sure, let me look up the weather for you.”
- Collect data inputs for action: Any parameters on the request like city, or apiKey
- API request: The endpoint URL, using variables if needed (e.g.
https://api.openweathermap.org/data/2.5/weather?q={{city}}&appid={{apikey}}&units=imperial
). - API Method: Choose GET, POST, PUT, or DELETE.
Use Case Examples
Upgrade Subscription
In this example, the AI agent helps users upgrade their plan. The API receives the current status and new plan name. The endpoint is:
https://api.socialintents.com/upgrade-subscription?status={{status}}&plan={{plan}}
When a user says “I want to upgrade to premium,” the AI uses this API to process the request and confirm the upgrade.
Weather Lookup
This action pulls weather data for a given city using a GET request to:
https://api.openweathermap.org/data/2.5/weather?q={{city}}&appid={{apikey}}&units=imperial
When a user says “What’s the weather in New York?”, the AI agent retrieves and summarizes the response.