Skip to main content
GET
/
CampaignItem
/
{campaignId}
/
items
Get campaign items with filters
curl --request GET \
  --url https://api.starleads.co/CampaignItem/{campaignId}/items \
  --header 'X-Api-Key: <api-key>'
import requests

url = "https://api.starleads.co/CampaignItem/{campaignId}/items"

headers = {"X-Api-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};

fetch('https://api.starleads.co/CampaignItem/{campaignId}/items', 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.starleads.co/CampaignItem/{campaignId}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <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.starleads.co/CampaignItem/{campaignId}/items"

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

req.Header.Add("X-Api-Key", "<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.starleads.co/CampaignItem/{campaignId}/items")
.header("X-Api-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.starleads.co/CampaignItem/{campaignId}/items")

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

request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "currentPage": 123,
  "totalPages": 123,
  "pageSize": 123,
  "totalCount": 123,
  "items": [
    {
      "id": "<string>",
      "campaignId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "processedAt": "2023-11-07T05:31:56Z",
      "lastCallDate": "2023-11-07T05:31:56Z",
      "attemptCount": 123,
      "phoneNumber": "<string>",
      "businessId": "<string>",
      "nextTryDate": "2023-11-07T05:31:56Z",
      "dataBag": {},
      "result": {
        "tag": {
          "id": "<string>",
          "name": "<string>",
          "color": "<string>"
        },
        "conversation": {
          "id": "<string>",
          "messages": [
            {
              "timestamp": "2023-11-07T05:31:56Z",
              "role": "<string>",
              "text": "<string>",
              "intent": "<string>"
            }
          ]
        },
        "summary": "<string>",
        "isSystem": true,
        "metadata": {}
      },
      "isArchived": true,
      "eventList": [
        {
          "date": "2023-11-07T05:31:56Z",
          "description": "<string>"
        }
      ]
    }
  ]
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}

Authorizations

X-Api-Key
string
header
required

Headers

X-Api-Key
string
required

Api key to pass as a X-Api-Key request header. You can get yours in your profile when authenticated in Starleads

Path Parameters

campaignId
string
required

ID of the campaign.

Query Parameters

RunningStatusList
enum<string>[]

Optional list of running statuses to filter items.

Available options:
Pending,
Calling,
Processed,
ProcessingResult,
Error
PageSize
integer<int32>
default:50

Number of items per page (default: 50).

PageNumber
integer<int32>
default:1

Page number to retrieve (default: 1).

StartLastCallDate
string<date-time>

Filter items with LastCallDate greater than or equal to this date.

EndLastCallDate
string<date-time>

Filter items with LastCallDate less than or equal to this date.

Response

Success

Paginated result containing campaign items.

currentPage
integer<int32>

Current page number.

totalPages
integer<int32>

Total number of pages.

pageSize
integer<int32>

Number of items per page.

totalCount
integer<int32>

Total number of items across all pages.

items
object[]

List of campaign items for the current page.