Guide for getting conversations from a agent.
The Get Conversations API endpoint allows you to retrieve conversations from a specific agent. You can filter conversations based on various criteria, including the agent's ID, date range, and filtered sources.
GET:https://www.chatzuri.com/api/v1/get-conversationsThe API request must include the following headers.
The request should include the following query parameters:
const options = {method: 'GET', headers: {accept: 'application/json'}};
fetch('https://www.chatzuri.com/api/v1/get-conversations?agentId=<agent-id>&startDate=2023-01-01&endDate=2023-12-12&page=1&size=20', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));The API response will be a JSON object with the following structure:
{
"data": [
{
"id": "string",
"created_at": "string",
"messages": [
{
"role": "string",
"content": "string"
}
],
"chatbot_id": "string",
"customer": "string",
"source": "string"
}
]
}The Get Conversations API endpoint provides a way to retrieve conversations from a agent based on specified filters. The response includes an array of conversations, each with its relevant details.
Successfully returns the conversations
If the start/end dates provided are invalid
If the API request is unauthorized
If the agentId provided is invalid
If there is an internal server error