cURL
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>",
"thread": {
"id": "<string>",
"agent": {
"id": "<string>",
"name": "<string>"
},
"end_user": {
"id": "<string>",
"display_name": "<string>",
"integration_type": "api",
"info": "<string>"
},
"integration": {
"id": "<string>",
"type": "api"
},
"updated_at": "2023-11-07T05:31:56Z",
"active": true,
"blocked": true,
"tags": [
{
"id": "<string>",
"name": "<string>",
"color": "blue"
}
],
"assigned_to": [
{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>"
}
]
},
"type": "inbound",
"status": "created",
"answered_by": "human",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"ended_by": "agent",
"ended_reason": "<string>",
"duration": 123,
"billed_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>",
"result": "met",
"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>"
}Llamadas
Start Call
Starts a Call
POST
/
call
cURL
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>",
"thread": {
"id": "<string>",
"agent": {
"id": "<string>",
"name": "<string>"
},
"end_user": {
"id": "<string>",
"display_name": "<string>",
"integration_type": "api",
"info": "<string>"
},
"integration": {
"id": "<string>",
"type": "api"
},
"updated_at": "2023-11-07T05:31:56Z",
"active": true,
"blocked": true,
"tags": [
{
"id": "<string>",
"name": "<string>",
"color": "blue"
}
],
"assigned_to": [
{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>"
}
]
},
"type": "inbound",
"status": "created",
"answered_by": "human",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"ended_by": "agent",
"ended_reason": "<string>",
"duration": 123,
"billed_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>",
"result": "met",
"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
Cuerpo
application/json
Respuesta
Call response