The ProbeDots API offers developers a comprehensive platform to integrate conversational AI capabilities and service and product recommendations into their applications. This documentation aims to help you understand how to set up and use this API effectively.
Registration and obtaining API keys:
Basic configuration:
// .env file
PROBEDOTS_API_KEY=your_unique_api_key
// Accessing the environment variable in your application
const apiKey = process.env.PROBEDOTS_API_KEY;
Making API calls:
fetch('<https://app.probedots.com/api/v1/tokens/>', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${apiKey}`,
},
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
This section provides a detailed reference for all available endpoints, including request methods, parameters, and response objects. Use it as your main resource for understanding how to interact with the ProbeDots API.
Create a token
/api/v1/tokens
POST
Content-Type
: application/json
Authorization
: Bearer <API-KEY>
{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJjb21wYW55X2lkIjoxLCJleHAiOjE3MjkxMTkxMTl9.dK0ERi5uTJXQwl2uqdrrFaEDI3qSReKbLgBClCgwk7U"
}
Create a chat session
/api/v1/chats
POST
Content-Type
: application/json
Authorization
: Bearer <token>
{
"chatter_info": "string", // optional
"chatter_external_id": "string" // optional
}
{
"chat_id": "string",
"greeting": "Greetings! How can I help you today?",
"suggestions": {
"suggestion_1": "I'm looking for a smartphone",
"suggestion_2": "I'm looking for a laptop",
// ... up to 5 suggestions from company settings
}
}
Send a message to a chat
/api/v1/chats/{chatId}/messages
POST
Content-Type
: application/json
Authorization
: Bearer <token>
{
"message": {
"content": "string",
"role": "20" // user message
}
}
{
"content": "string", // message answer
"no_products_available": true, // if no products returned after AI product query
"product1_name": "string", // if product1 provided by AI
"product1_link": "string",
"product1_image": "string",
"product1_details": {
"brand": "Dell",
"price": "1641.16",
// ... all other product details available in Probedots
},
"product2_name": "string", // if product2 provided by AI
// ... product 3
}
Retrieve an AI post-recommendation comment
/api/v1/chats/{chatId}/messages
POST
Content-Type
: application/json
Authorization
: Bearer <token>
{
"message": {
"content": "run_ai_comment", //must use this exact string
"role": "0" // system message
}
}
{
"content": "string", // message answer
}
Retrieve chat history
/api/v1/chats/{chatId}/load_chat
GET
Authorization
: Bearer <token>
{
"chat_id": {chatId},
"items": [
{
"type": "message",
"role": "assistant",
"content": "You're here! Let's make your wallet (and the planet) happy with some killer deals",
"created_at": "2024-10-16T21:13:25.568Z"
},
{
"type": "message",
"role": "user",
"content": "I'm looking for a smartphone",
"created_at": "2024-10-16T21:13:28.613Z"
},
{
"type": "message",
"role": "assistant",
"content": "",
"created_at": "2024-10-16T21:13:47.106Z"
},
{
"type": "recommendation",
"product_name": "iPhone 14 Plus",
"product_link": "product_link",
"product_image": "product_image",
"product_details": {
"brand": "Apple",
/// product details
},
"original_prompt": "user need summed up by the AI",
"created_at": "2024-10-16T21:13:52.326Z"
}
/// other messages and product/content recommendations
]
}
Retrieve a chatter's conversation
/api/v1/chatters/load_chat?external_id={chatter_id}&chat_id={chat_id}
GET
Authorization
: Bearer <token>
{
"chat_id": {chatId},
"items": [
{
"type": "message",
"role": "assistant",
"content": "You're here! Let's make your wallet (and the planet) happy with some killer deals",
"created_at": "2024-10-16T21:13:25.568Z"
},
{
"type": "message",
"role": "user",
"content": "I'm looking for a smartphone",
"created_at": "2024-10-16T21:13:28.613Z"
},
{
"type": "message",
"role": "assistant",
"content": "",
"created_at": "2024-10-16T21:13:47.106Z"
},
{
"type": "recommendation",
"product_name": "iPhone 14 Plus",
"product_link": "product_link",
"product_image": "product_image",
"product_details": {
"brand": "Apple",
/// product details
},
"original_prompt": "user need summed up by the AI",
"created_at": "2024-10-16T21:13:52.326Z"
}
/// other messages and product/content recommendations
]
}