Skip to main content
GET
/
api
/
v1
/
campaigns
/
{campaign_id}
/
targets
Get Campaign Targets
curl --request GET \
  --url https://api.example.com/api/v1/campaigns/{campaign_id}/targets
import requests

url = "https://api.example.com/api/v1/campaigns/{campaign_id}/targets"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/api/v1/campaigns/{campaign_id}/targets', 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.example.com/api/v1/campaigns/{campaign_id}/targets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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.example.com/api/v1/campaigns/{campaign_id}/targets"

req, _ := http.NewRequest("GET", url, nil)

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.example.com/api/v1/campaigns/{campaign_id}/targets")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/campaigns/{campaign_id}/targets")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "targets": [
    {
      "id": "<string>",
      "target_url": "<string>",
      "organization_id": "<string>",
      "campaign_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "execution_minutes": 123,
      "input_data": {},
      "output_data": {},
      "call_log_ids": [
        123
      ],
      "last_call_date": "2023-11-07T05:31:56Z",
      "phone_number": "<string>",
      "fax_links": [
        "<string>"
      ],
      "payor_api_data": {},
      "external_id": "<string>",
      "updated_at": "2023-11-07T05:31:56Z",
      "retries": 123,
      "scheduled_time": "2023-11-07T05:31:56Z",
      "categorization": {},
      "outcome": "<string>",
      "statistics": {}
    }
  ],
  "page_count": 123,
  "next_page": 123
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Path Parameters

campaign_id
string
required

The ID of the campaign.

Query Parameters

page
integer
default:0

The page number to get.

Required range: x >= 0
limit
integer
default:10

The number of targets per page.

Required range: 1 <= x <= 100
status
enum<string> | null

The status of the targets to get.

Available options:
Pending,
Scheduled,
In Progress,
Post-processing,
Finished,
To review,
Failed,
Waiting,
SMS Scheduled
from_date
string<date-time> | null

The start date to get.

Example:

"2024-01-01"

to_date
string<date-time> | null

The end date to get.

Example:

"2024-01-01"

from_last_call_date
string<date-time> | null

The date to get targets from the last call date.

Example:

"2024-01-01"

to_last_call_date
string<date-time> | null

The date to get targets to the last call date.

Example:

"2024-01-01"

Response

Successful Response

targets
CampaignTargetResponse · object[]
required
page_count
integer | null
next_page
integer | null