Creating a developer account
Go to kollie.ai and sign up for an account. Once you’ve done that, you’ll be able to access your API key.Creating your first phone call
curl -X POST 'https://api.kollie.ai/api/v1/agents/{agent_id}/call' \
-H "X-API-Key: your_api_token" \
-H 'Content-Type: application/json' \
-d '{
"to_phone": "+1234567890",
}'
import requests
# Replace with your actual API token and agent ID
api_token = 'YOUR_API_TOKEN'
agent_id = 'YOUR_AGENT_ID'
# API endpoint URL
url = f'https://api.kollie.ai/api/v1/agents/{agent_id}/call'
# Headers for the request
headers = {
'X-API-Key': f'{api_token}',
'Content-Type': 'application/json'
}
# Payload data
data = {
"to_phone": "+1234567890"
}
# Make the POST request
response = requests.post(url, headers=headers, json=data)
# Check the response
if response.status_code == 200:
print("Call initiated successfully.")
print("Response data:", response.json())
else:
print(f"Failed to initiate call. Status code: {response.status_code}")
print("Error message:", response.text)
// Replace with your actual API token and agent ID
const apiToken = 'YOUR_API_TOKEN';
const agentId = 'YOUR_AGENT_ID';
// API endpoint URL
const url = `https://api.kollie.ai/api/v1/agents/${agentId}/call`;
// Headers for the request
const headers = {
'X-API-Key': `${apiToken}`,
'Content-Type': 'application/json'
};
// Payload data
const data = {
to_phone: '+1234567890'
};
// Make the POST request
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(responseData => {
console.log('Call initiated successfully.');
console.log('Response data:', responseData);
})
.catch(error => {
console.error('Failed to initiate call:', error);
});

