Get Bot Requests
GET https://api.unltd.ai/v1/requests/
This endpoint retrieves a list of BotRequest entities associated with the authenticated user. The response can be tailored using the provided query parameters. These parameters enable filtering of bot requests by bot name, as well as pagination and sorting of the response. Please note, the results are strictly user-specific, returning only bot requests relevant to the authenticated user.
Query Parameters
name
String
The name of the bot to filter requests by.
sortBy
String
The attribute to sort by.
limit
Integer
The maximum number of bot requests to return.
page
Integer
The page number to return in the paginated response.
Permissions
API Example
const fetch = require('node-fetch');
async function fetchApiData() {
const response = await fetch('https://api.unltd.ai/v1/requests/', {
method: 'GET',
headers: {
'Authorization': 'Bearer ',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
}
fetchApiData();
Response Object
200 success
The response object contains the following properties:
- results: An array of BotRequest entities.
- page: The current page number.
- limit: The maximum number of results per page.
- totalPages: The total number of pages.
- totalResults: The total number of BotRequest entities.
{
"results": [
{
"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"
}
],
"page": 1,
"limit": 10,
"totalPages": 1,
"totalResults": 1
}
Get Custom Bot Requests
GET https://api.unltd.ai/v1/organizations/example_organization_id/requests/
This endpoint retrieves a list of BotRequest entities associated with the given organization ID. The authenticated user needs to be a part of the specified organization. The response can be customized using the provided query parameters, which allow filtering of bot requests by bot name, as well as pagination and sorting of the response.
Query Parameters
name
String
The name of the bot to filter requests by.
sortBy
String
The attribute to sort by.
limit
Integer
The maximum number of bot requests to return.
page
Integer
The page number to return in the paginated response.
Permissions
API Example
const fetch = require('node-fetch');
async function fetchApiData() {
const response = await fetch('https://api.unltd.ai/v1/organizations/example_organization_id/requests/', {
method: 'GET',
headers: {
'Authorization': 'Bearer ',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
}
fetchApiData();
Response Object
200 success
The response object contains the following properties:
- results: An array of BotRequest entities.
- page: The current page number.
- limit: The maximum number of results per page.
- totalPages: The total number of pages.
- totalResults: The total number of BotRequest entities.
{
"results": [
{
"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"
}
],
"page": 1,
"limit": 10,
"totalPages": 1,
"totalResults": 1
}
Get Single Bot Request
GET https://api.unltd.ai/v1/requests/:botRequestId/
This endpoint retrieves a specific BotRequest entity based on the provided bot request ID. The response contains detailed information about the requested bot request. Depending on the user's role and associated organizations, different information may be returned.
Path Parameters
botRequestId
string
The unique ID of the bot request to be retrieved.
Permissions
API Example
const fetch = require('node-fetch');
async function fetchApiData() {
const response = await fetch('https://api.unltd.ai/v1/requests/example_request/', {
method: 'GET',
headers: {
'Authorization': 'Bearer ',
'Content-Type': 'application/json',
},
});
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"
}
Get Single Bot Request for an Organization
GET https://api.unltd.ai/v1/organizations/:organizationId/requests/:botRequestId/
This endpoint retrieves a specific BotRequest entity for an organization based on the provided bot request ID. The response contains detailed information about the requested bot request.
Path Parameters
organizationId
string
The unique ID of the organization.
botRequestId
string
The unique ID of the bot request to be retrieved.
Permissions
API Example
const fetch = require('node-fetch');
async function fetchApiData() {
const response = await fetch('https://api.unltd.ai/v1/organizations/example_organization/requests/example_request/', {
method: 'GET',
headers: {
'Authorization': 'Bearer ',
'Content-Type': 'application/json',
},
});
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"
}