curl --request POST \
--url https://api.altur.io/api/v1.0/call \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"phone_number_to": "<string>",
"end_user_display_name": "<string>",
"end_user_context": "<string>",
"initial_message": "<string>"
}
'import requests
url = "https://api.altur.io/api/v1.0/call"
payload = {
"agent_id": "<string>",
"phone_number_to": "<string>",
"end_user_display_name": "<string>",
"end_user_context": "<string>",
"initial_message": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
phone_number_to: '<string>',
end_user_display_name: '<string>',
end_user_context: '<string>',
initial_message: '<string>'
})
};
fetch('https://api.altur.io/api/v1.0/call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.altur.io/api/v1.0/call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'phone_number_to' => '<string>',
'end_user_display_name' => '<string>',
'end_user_context' => '<string>',
'initial_message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.altur.io/api/v1.0/call"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"phone_number_to\": \"<string>\",\n \"end_user_display_name\": \"<string>\",\n \"end_user_context\": \"<string>\",\n \"initial_message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.altur.io/api/v1.0/call")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"phone_number_to\": \"<string>\",\n \"end_user_display_name\": \"<string>\",\n \"end_user_context\": \"<string>\",\n \"initial_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"phone_number_to\": \"<string>\",\n \"end_user_display_name\": \"<string>\",\n \"end_user_context\": \"<string>\",\n \"initial_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"thread": {
"id": "<string>",
"agent": {
"id": "<string>",
"name": "<string>"
},
"end_user": {
"id": "<string>",
"display_name": "<string>",
"info": "<string>"
},
"integration": {
"id": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z",
"active": true,
"blocked": true,
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"assigned_to": [
{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>"
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"ended_reason": "<string>",
"duration": 123,
"billable_duration": 123,
"policy_evaluation": {
"score": 123,
"policies_evaluated_count": 123,
"policies_met_count": 123,
"policies_not_applicable_count": 123,
"completed": true,
"completed_at": "2023-11-07T05:31:56Z",
"policies": [
{
"policy_id": "<string>",
"policy_name": "<string>",
"explanation": "<string>",
"evaluated_at": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Start Call
Starts a Call
curl --request POST \
--url https://api.altur.io/api/v1.0/call \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"phone_number_to": "<string>",
"end_user_display_name": "<string>",
"end_user_context": "<string>",
"initial_message": "<string>"
}
'import requests
url = "https://api.altur.io/api/v1.0/call"
payload = {
"agent_id": "<string>",
"phone_number_to": "<string>",
"end_user_display_name": "<string>",
"end_user_context": "<string>",
"initial_message": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
phone_number_to: '<string>',
end_user_display_name: '<string>',
end_user_context: '<string>',
initial_message: '<string>'
})
};
fetch('https://api.altur.io/api/v1.0/call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.altur.io/api/v1.0/call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'phone_number_to' => '<string>',
'end_user_display_name' => '<string>',
'end_user_context' => '<string>',
'initial_message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.altur.io/api/v1.0/call"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"phone_number_to\": \"<string>\",\n \"end_user_display_name\": \"<string>\",\n \"end_user_context\": \"<string>\",\n \"initial_message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.altur.io/api/v1.0/call")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"phone_number_to\": \"<string>\",\n \"end_user_display_name\": \"<string>\",\n \"end_user_context\": \"<string>\",\n \"initial_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"phone_number_to\": \"<string>\",\n \"end_user_display_name\": \"<string>\",\n \"end_user_context\": \"<string>\",\n \"initial_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"thread": {
"id": "<string>",
"agent": {
"id": "<string>",
"name": "<string>"
},
"end_user": {
"id": "<string>",
"display_name": "<string>",
"info": "<string>"
},
"integration": {
"id": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z",
"active": true,
"blocked": true,
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"assigned_to": [
{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>"
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"ended_reason": "<string>",
"duration": 123,
"billable_duration": 123,
"policy_evaluation": {
"score": 123,
"policies_evaluated_count": 123,
"policies_met_count": 123,
"policies_not_applicable_count": 123,
"completed": true,
"completed_at": "2023-11-07T05:31:56Z",
"policies": [
{
"policy_id": "<string>",
"policy_name": "<string>",
"explanation": "<string>",
"evaluated_at": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Autorizaciones
Add api-key YOUR_API_SECRET_KEY as the value of the Authorization header.
Cuerpo
Unique identifier of the Agent that will participate in the Call (formerly Chatbot or Assistant)
E.164 formatted phone number of the EndUser to call
Display name of the EndUser to call
Context of the EndUser to call
Initial message the Agent will say upon the call being answered
Respuesta
Call response
Unique identifier for the Call
Show child attributes
Show child attributes
Type of the Call
inbound, outbound Status of the Call
created, queued, ringing, in-progress, forwarding, ended, busy, no-answer, failed Who or what answered the Call
human, machine, unknown Datetime from when the Call was created
Datetime from when the Call was started
Datetime from when the Call was ended
Who ended the Call (agent, user or system). Empty if the call never connected
agent, user, system, Brief reason why the Call ended. Empty if not available
Duration of the Call in seconds
Billable duration of the Call in seconds
Policy compliance evaluation results
Show child attributes
Show child attributes