cURL
Overview
The Acro SDK allows developers to seamlessly integrate with the Acro platform, providing detailed observability into the performance of your AI Assistants and chatbots. With this SDK, you can monitor conversations, analyze interactions, and enhance user experiences with ease.
Installation
No installation needed - cURL comes pre-installed on most systems. If not installed, you can get it from:
# Ubuntu/Debian
sudo apt-get install curl
# macOS (Homebrew)
brew install curl
Using the API
To send conversation data to the Acro platform, follow these steps:
Initialize the configuration
Log in to app.acro.so, create an application, and set up your credentials:
export APPLICATION_ID="your_application_id"
export APPLICATION_SECRET="your_application_secret"
export ACRO_URL="https://data.acro.so/$APPLICATION_ID/conversation"
Properties
Required Information
Property | Type | Required | Description | Constraints |
---|---|---|---|---|
conversationId | UUID string | Yes | Unique identifier for the conversation | Valid UUID format |
lines | Array | Yes | Complete transcript of the conversation | See Lines Schema below |
start | Date/string | Yes | When the conversation began | ISO date string or Date object |
End User Information
The person interacting with your AI Agent.
Property | Type | Required | Description | Constraints |
---|---|---|---|---|
customerId | string | No | Unique identifier for the customer | Max 64 chars |
customerEmail | string | No | Customer’s email address | Max 320 chars, valid email |
customerPhone | string | No | Customer’s phone number | Max 128 chars |
Agent Information
The AI Agent properties.
Property | Type | Required | Description | Constraints |
---|---|---|---|---|
agentId | string | No | Identifier for the AI agent | Max 64 chars |
agentVersion | string | No | Version of the AI agent | Max 128 chars |
Client Information
This refers to the business using your AI Agent to run their operations.
Property | Type | Required | Description | Constraints |
---|---|---|---|---|
externalCompanyId | string | No | Client company identifier | Max 64 chars |
externalCompanyName | string | No | Client company name | Max 256 chars |
externalCompanyType | string | No | Industry/category of client | Max 128 chars |
Conversation Metadata
More optional metadata so that we can analyze your agent.
Property | Type | Required | Description | Constraints |
---|---|---|---|---|
source | Enum | No | Origin of conversation | Max 64 chars |
end | Date/string | No | When conversation ended | ISO date string or Date object |
duration | number | No | Length of conversation | Integer (seconds) |
transfer | boolean | No | Whether conversation was transferred | - |
completed | boolean | No | Whether conversation finished normally | - |
textUrl | string | No | URL to conversation transcript | Valid URL |
audioUrl | string | No | URL to conversation recording | Valid URL |
Lines Schema
Each line in the lines
array must conform to this structure:
Property | Type | Required | Description |
---|---|---|---|
role | Enum | Yes | Who is speaking/acting |
content | string|null | Yes | The message content |
timestamp | Date/string | No | When this line occurred |
Valid Role Values
"AI_ASSISTANT"
: AI agent messages"USER"
: End user messages"HUMAN"
: Human agent messages"TOOL"
: System actions/events"assistant"
: Alternative for AI_ASSISTANT"user"
: Alternative for USER"tool"
: Alternative for TOOL"system"
: System messages
Example Usage
# Configuration
export APPLICATION_ID="your_application_id"
export APPLICATION_SECRET="your_application_secret"
export ACRO_URL="https://data.acro.so/$APPLICATION_ID/conversation"
# Send request
curl -X POST "$ACRO_URL" \
-H "Authorization: Bearer $APPLICATION_SECRET" \
-H "Content-Type: application/json" \
-d '{
"conversationId": "123e4567-e89b-12d3-a456-426614174000",
"source": "mywebsite.com",
"customerId": "cust_123",
"start": "2024-09-11T16:55:49.789Z",
"lines": [
{
"role": "AI_ASSISTANT",
"content": "Hello! How can I help you today?",
"timestamp": "2024-09-11T16:55:49.789Z"
},
{
"role": "USER",
"content": "I need help with my order",
"timestamp": "2024-09-11T16:55:50.789Z"
}
]
}'
Response Types
Success Response
{
"conversationId": "123e4567-e89b-12d3-a456-426614174000",
"requestId": "req_abc123"
}
Error Response
{
"error": "Error message description",
"requestId": "req_abc123"
}
Need help? Join our Discord community or Schedule a meeting with us.