Create Bot Request
POST https://api.unltd.ai/v1/bots/:botSlug/request/
This endpoint creates a new BotRequest entity for a specific bot based on the provided information in the request body.
Request Body
inputs
object
The inputs for the bot follow a {name: value} structure in which 'name' corresponds to the botInput name defined by the bot and 'value' corresponds to the actual input provided by the user.
Permissions
API Example
const fetchApiData = async () => {
const response = await fetch("https://api.unltd.ai/v1/bots/example_bot_slug/request/", {
method: 'POST',
headers: {
'Authorization': 'Bearer ',
'Content-Type': 'application/json',
},
body: JSON.stringify({
inputs: '[object Object]'
})
});
const data = await response.json();
console.log(data);
};
fetchApiData();
{
"bot": {
"creditCost": 10,
"name": "Example bot",
"slug": "example_bot"
},
"createdBy": {
"name": "John Doe"
},
"organization": {
"name": "Test Organization"
},
"inputs": {
"color": "Green"
},
"ip": "29.251.124.244",
"response": {
"message": "Hello world"
},
"createdAt": "2023-06-28T05:38:00.418Z",
"updatedAt": "2023-06-28T05:38:06.922Z",
"id": "649bc73858b7391cbaa555ff"
}
Create Public Custom Bot Request
POST https://api.unltd.ai/v1/:organizationId/bots/:botSlug/request/
This endpoint creates a new BotRequest entity for a specific bot and organization based on the provided information in the request body. It requires the bot to belong to the specified organization and the authenticated user or organization token to have access to the organization.
Request Body
inputs
object
The inputs for the bot follow a {name: value} structure in which 'name' corresponds to the botInput name defined by the bot and 'value' corresponds to the actual input provided by the user.
Permissions
API Example
const fetchApiData = async () => {
const response = await fetch("https://api.unltd.ai/v1/example_organization_id/bots/example_bot_slug/request/", {
method: 'POST',
headers: {
'Authorization': 'Bearer ',
'Content-Type': 'application/json',
},
body: JSON.stringify({
inputs: '[object Object]'
})
});
const data = await response.json();
console.log(data);
};
fetchApiData();
{
"bot": {
"creditCost": 10,
"name": "Example bot",
"slug": "example_bot"
},
"createdBy": {
"name": "John Doe"
},
"organization": {
"name": "Test Organization",
"id": "example_organization_id"
},
"inputs": {
"color": "Green"
},
"ip": "29.251.124.244",
"response": {
"message": "Hello world"
},
"createdAt": "2023-06-28T05:38:00.418Z",
"updatedAt": "2023-06-28T05:38:06.922Z",
"id": "649bc73858b7391cbaa555ff"
}