Campaign Details

SMS V3 APIs

One campaign: when it runs, its status, and once it has run how many messages were queued and what it cost.

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

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, from Create Campaign or List Campaigns.

Example request

curl --location --request GET 'https://telcomw.com/api/v3/campaigns/42' \
  --header 'X-API-Key: YOUR_API_KEY'
curl --location --request GET "https://telcomw.com/api/v3/campaigns/42" ^
  --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');
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',
  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

headers = {
    'X-API-Key': 'YOUR_API_KEY'
}

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

Response

The response is JSON.

Response (200)

{
  "success": true,
  "request_id": "req_5f2c9a1d0e7b4a63",
  "data": {
    "campaign_id": 42,
    "name": "November sale",
    "sender_id": "WGIT",
    "message": "Our sale starts today. Visit us!",
    "status": "completed",
    "scheduled_at": "2026-11-20T07:00:00.000Z",
    "recipients_source": "numbers",
    "group_id": null,
    "recipients": 2,
    "queued": 2,
    "failed": 0,
    "cost": 40,
    "currency": "MWK",
    "notify_before": true,
    "batch_ids": [
      "k3m9x2p7q1ab"
    ],
    "error": null,
    "started_at": "2026-11-20T07:00:01.000Z",
    "completed_at": "2026-11-20T07:00:03.000Z",
    "created_at": "2026-11-05T09:12:44.000Z"
  }
}

No such campaign (404)

{
  "success": false,
  "request_id": "req_5f2c9a1d0e7b4a63",
  "error": {
    "code": "CAMPAIGN_NOT_FOUND",
    "message": "No campaign with this id on your account."
  }
}

Fields explained

FieldDescription
successtrue when the request worked.
request_idThe number of this request. Quote it if you contact us.
data.campaign_idThe id of the campaign. Use it in the other campaign calls.
data.statusscheduled, running, completed, failed or cancelled.
data.scheduled_atWhen the campaign runs (UTC).
data.recipients_sourcenumbers (a list you sent) or group (a phonebook group).
data.recipientsHow many numbers the campaign has.
data.queuedAfter it ran: how many messages were queued for delivery.
data.failedAfter it ran: how many could not be queued.
data.costAfter it ran: what it cost, in MWK. 0 before.
data.errorWhy a failed campaign failed, otherwise null.
data.batch_idsAfter the campaign ran: the ids of its sends. Use one as batch_id in Delivery Reports to follow every message of the campaign.

Good to know

  • status: scheduled (waiting for its time), running (being sent now), completed (messages were queued), failed (nothing could be sent, error says why, for example not enough balance), cancelled.