Get Campaign
Retrieve the full details of a single SMS campaign by its ID.
Endpoint
GET /sms/campaigns/:id
Returns: 200 OK
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The campaign ID. |
Response
{
"id": "0192a1b2-c3d4-7e5f-9000-abcdef123456",
"name": "Summer Sale 2026",
"description": "Sale announcement to KSA list",
"content": "Acme Store: 50% off everything this weekend! Shop now: {{link}}",
"from": "ACME",
"country": "SA",
"status": "Draft",
"num_segments": 1,
"scheduled_at": null,
"sent_at": null,
"created_at": "2026-04-27T12:00:00.000Z",
"updated_at": "2026-04-27T12:00:00.000Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique campaign ID. |
name | string | null | Internal name for the campaign. |
description | string | null | Internal description for the campaign. |
content | string | null | The SMS message body. |
from | string | null | Registered sender name used to deliver the campaign. |
country | string | null | ISO 3166-1 alpha-2 country code auto-detected from the registered sender name (e.g. SA for Saudi Arabia, EG for Egypt). |
status | string | Campaign status. One of Draft, Scheduled, Queued, Sending, Sent, Paused, Failed, Cancelled. |
num_segments | number | Number of SMS parts the message will be split into. 1 until the campaign is sent. |
scheduled_at | string | null | ISO 8601 datetime if the campaign is scheduled; otherwise null. |
sent_at | string | null | ISO 8601 datetime when the campaign finished sending; otherwise null. |
created_at | string | ISO 8601 datetime when the campaign was created. |
updated_at | string | ISO 8601 datetime when the campaign was last updated. |
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl "https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456" \
-H "Authorization: Bearer $ARSEL_API_KEY"
const response = await fetch("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456", {
headers: {
Authorization: `Bearer ${process.env.ARSEL_API_KEY}`,
},
});
const data = await response.json();
if (!response.ok) {
throw new Error(`${data.name}: ${data.message}`);
}
console.log(data);
import os
import requests
response = requests.get(
"https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456",
headers={"Authorization": f"Bearer {os.environ['ARSEL_API_KEY']}"},
)
response.raise_for_status()
print(response.json())
using System.Net.Http.Headers;
var client = new HttpClient(); // share one instance across requests
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ARSEL_API_KEY"));
var response = await client.GetAsync("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456");
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException($"{(int)response.StatusCode}: {body}");
Console.WriteLine(body);
<?php
$ch = curl_init("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ARSEL_API_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) {
throw new Exception("{$data['name']}: {$data['message']}");
}
print_r($data);
Error Responses
- 404 Not Found
- 401 Unauthorized
{
"status_code": 404,
"name": "not_found",
"message": "Campaign not found"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid API Key"
}