Get a campaign
curl --request GET \
--url https://api.openmic.ai/v1/campaigns/{campaign_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{campaign_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmic.ai/v1/campaigns/{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{
"id": 123,
"name": "<string>",
"type": "outbound",
"status": "Scheduled",
"bot_uid": "<string>",
"from_number": "<string>",
"contact_list_id": 123,
"time_start": "<string>",
"time_end": "<string>",
"timezone": "<string>",
"days": [
"Monday"
],
"schedule_type": "single",
"current_index": 123,
"total_contacts": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Campaigns
Get a campaign
GET
/
v1
/
campaigns
/
{campaign_id}
Get a campaign
curl --request GET \
--url https://api.openmic.ai/v1/campaigns/{campaign_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{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.openmic.ai/v1/campaigns/{campaign_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmic.ai/v1/campaigns/{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{
"id": 123,
"name": "<string>",
"type": "outbound",
"status": "Scheduled",
"bot_uid": "<string>",
"from_number": "<string>",
"contact_list_id": 123,
"time_start": "<string>",
"time_end": "<string>",
"timezone": "<string>",
"days": [
"Monday"
],
"schedule_type": "single",
"current_index": 123,
"total_contacts": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
API key authentication. Include your API key in the Authorization header as: Authorization: Bearer <your-api-key>
Path Parameters
Response
Campaign details
Unique identifier.
Campaign name.
Campaign type (always outbound).
Available options:
outbound Current campaign status.
Available options:
Scheduled, Running, Stopped, Completed, Failed, Expired, Paused Bot UID for API reference.
Phone number used to dial from (E.164 format).
Associated contact list ID.
Daily calling window start time in HH:MM format.
Daily calling window end time in HH:MM format.
Calling window timezone (IANA format).
Days of week the campaign runs on (for recurring campaigns).
Available options:
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday Schedule type: single (one-time) or multi (recurring on specific days).
Available options:
single, multi Number of contacts already called.
Total number of contacts in the campaign's contact list.
Was this page helpful?