Campaigns
Get campaign
Read one campaign, with its counters and its import’s progress: lines read of the total, contacts added, and the lines skipped with their reasons.
GET
/
v2
/
campaign
/
{id}
Get campaign
curl --request GET \
--url https://api.verbeo.ai/v2/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v2/campaign/{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.verbeo.ai/v2/campaign/{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: Bearer <token>"
],
]);
$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.verbeo.ai/v2/campaign/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.verbeo.ai/v2/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyReturns one campaign with its import: how far the import has got, the contacts it added, and the lines it skipped with why. Read it every few seconds while the import runs; the campaign can start once
And the errors every route can give.
import.status is done.
Who may call it: any API key of the workspace; in the dashboard, any member.
Path
Request
curl "https://api.verbeo.ai/v2/campaign/0175091d-2c3b-4aef-8c45-dbbe24f7b3ff" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
200 OK with the campaign object and its whole import object.
{
"success": true,
"data": {
"id": "0175091d-2c3b-4aef-8c45-dbbe24f7b3ff",
"campaign_name": "Spring renewals",
"status": "draft",
"total_contacts": 34998,
"import": {
"id": "9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b",
"status": "importing",
"total_lines": 50000,
"lines_read": 35000,
"contacts_added": 34998,
"rows_skipped": 2,
"skipped": [
{ "line": 12, "reason": "phone_number: must be a number in +E.164 format, e.g. +14155550123" },
{ "line": 4108, "reason": "not valid JSON" }
],
"error_message": null,
"…": "the rest of the import object"
},
"…": "the rest of the campaign object"
}
}
Errors
| Code | Status | When |
|---|---|---|
NOT_FOUND | 404 | Campaign not found: no campaign with this id in your workspace. |
VALIDATION_FAILED | 422 | id is not a UUID: must be a valid uuid. |
Was this page helpful?
⌘I
Get campaign
curl --request GET \
--url https://api.verbeo.ai/v2/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v2/campaign/{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.verbeo.ai/v2/campaign/{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: Bearer <token>"
],
]);
$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.verbeo.ai/v2/campaign/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.verbeo.ai/v2/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body