cURL
curl --request GET \
--url https://api.altur.io/api/v1.0/campaigns/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.altur.io/api/v1.0/campaigns/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.altur.io/api/v1.0/campaigns/{id}', 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/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.altur.io/api/v1.0/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.altur.io/api/v1.0/campaigns/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"campaign": {
"id": 123,
"name": "<string>",
"integration": {
"id": "<string>"
},
"agent": {
"id": "<string>",
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"scheduling": {
"mon": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"tue": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"wed": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"thu": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"fri": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sat": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sun": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
}
},
"cycles": {
"enabled": true,
"max_iterations": 7,
"cooldown_minutes": 720,
"filter_statuses": [
"<string>"
],
"filter_tags": [
"<string>"
],
"schedule": {
"mon": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"tue": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"wed": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"thu": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"fri": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sat": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sun": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
}
},
"schedule_start_date": "2023-12-25",
"schedule_end_date": "2023-12-25"
},
"analytics": {}
}
}{
"error": 123,
"message": "<string>"
}{
"success": false,
"message": "<string>",
"field": "<string>"
}Campaigns
Retrieve Campaign
Devuelve el detalle de una Campaña, incluyendo agente, integración, configuración de ciclos y (cuando esté disponible) snapshot de analíticas.
GET
/
campaigns
/
{id}
cURL
curl --request GET \
--url https://api.altur.io/api/v1.0/campaigns/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.altur.io/api/v1.0/campaigns/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.altur.io/api/v1.0/campaigns/{id}', 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/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.altur.io/api/v1.0/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.altur.io/api/v1.0/campaigns/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"campaign": {
"id": 123,
"name": "<string>",
"integration": {
"id": "<string>"
},
"agent": {
"id": "<string>",
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"scheduling": {
"mon": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"tue": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"wed": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"thu": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"fri": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sat": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sun": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
}
},
"cycles": {
"enabled": true,
"max_iterations": 7,
"cooldown_minutes": 720,
"filter_statuses": [
"<string>"
],
"filter_tags": [
"<string>"
],
"schedule": {
"mon": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"tue": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"wed": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"thu": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"fri": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sat": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
},
"sun": {
"startTime": "<string>",
"stopTime": "<string>",
"active": true
}
},
"schedule_start_date": "2023-12-25",
"schedule_end_date": "2023-12-25"
},
"analytics": {}
}
}{
"error": 123,
"message": "<string>"
}{
"success": false,
"message": "<string>",
"field": "<string>"
}Rate Limit: 12 requests per second
agent, integration, cycles config and, when available, an analytics snapshot. The shape of analytics depends on the campaign’s integration.type:
phone_call: call and contact counts and rates (e.g.calls,contactsAnswered,contactsConvertedRate).whatsapp: message lifecycle counts and rates (e.g.sent,delivered,read,convertedRate).
Examples
curl "https://api.altur.io/api/v1.0/campaigns/1234" \
-H "Authorization: api-key YOUR_API_SECRET_KEY"
import requests
response = requests.get(
"https://api.altur.io/api/v1.0/campaigns/1234",
headers={"Authorization": "api-key YOUR_API_SECRET_KEY"},
)
response.raise_for_status()
campaign = response.json()["campaign"]
analytics = campaign.get("analytics")
const res = await fetch("https://api.altur.io/api/v1.0/campaigns/1234", {
headers: { Authorization: "api-key YOUR_API_SECRET_KEY" },
});
const { campaign } = await res.json();
const analytics = campaign.analytics;
Authorizations
Add api-key YOUR_API_SECRET_KEY as the value of the Authorization header.
Path Parameters
The identifier of the Campaign
⌘I