Campaign Numbers

SMS V3 APIs

The phone numbers of a campaign, in pages.

GEThttps://telcomw.com/api/v3/campaigns/42/recipients

Put the campaign_id in the URL. Your API key goes in the X-API-Key header.

Parameters

Parameter Sent in Required Description
X-API-Key header YES Your API key, sent as a header. You can also send it as Authorization: Bearer YOUR_API_KEY.
campaign_id path YES The id of the campaign.
page query NO The page number, starting at 1.
per_page query NO How many numbers in a page, 1 to 1,000. The default is 100.

Example request

curl --location --request GET 'https://telcomw.com/api/v3/campaigns/42/recipients?page=1&per_page=100' \
  --header 'X-API-Key: YOUR_API_KEY'
curl --location --request GET "https://telcomw.com/api/v3/campaigns/42/recipients?page=1&per_page=100" ^
  --header "X-API-Key: YOUR_API_KEY"
<?php

$headers = [
    'X-API-Key: YOUR_API_KEY',
];

$ch = curl_init('https://telcomw.com/api/v3/campaigns/42/recipients?page=1&per_page=100');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
const axios = require('axios');

axios.request({
  method: 'get',
  url: 'https://telcomw.com/api/v3/campaigns/42/recipients',
  params: {
    'page': '1',
    'per_page': '100'
  },
  headers: {
    'X-API-Key': 'YOUR_API_KEY'
  }
}).then((res) => console.log(res.data))
  .catch((err) => console.error(err.response ? err.response.data : err.message));
import requests

params = {
    'page': '1',
    'per_page': '100'
}
headers = {
    'X-API-Key': 'YOUR_API_KEY'
}

response = requests.request('GET', 'https://telcomw.com/api/v3/campaigns/42/recipients', params=params, headers=headers)
print(response.json())

Response

The response is JSON.

Response (200)

{
  "success": true,
  "request_id": "req_5f2c9a1d0e7b4a63",
  "data": {
    "campaign_id": 42,
    "numbers": [
      "265999123456",
      "265888123456"
    ],
    "pagination": {
      "page": 1,
      "per_page": 100,
      "total": 2,
      "pages": 1
    }
  }
}

Fields explained

FieldDescription
data.numbersThe numbers in international format, in the order they were saved.