SMS Misr

Developer tools

SMS API

Let your ordering system or application start a send, review the cost and track the result programmatically.

Walkthrough

Step by step

  1. Create a scoped key in Connection details and keep its secret on your server.

  2. Use the API base for your tenant and provide the client ID and bearer key in the headers.

  3. For a campaign call POST /campaigns and save the preview ID. Review cost and eligibility before confirmation.

  4. After confirming, follow the report endpoint. Reuse the same idempotency key when retrying the same operation.

Implementation guide

Connect your application

Use a key with campaign permissions. The creation request prepares a preview. Review the quote and confirm in a separate request.

POST /api/v2/campaigns

Set SMS_API to your full API base URL. Keep credentials in the server environment.

cURL
curl --request POST "$SMS_API/campaigns" \
  -H "Content-Type: application/json" \
  -H "X-Client-Id: $SMS_CLIENT_ID" \
  -H "Authorization: Bearer $SMS_API_KEY" \
  -H "Idempotency-Key: $REQUEST_UUID" \
  --data '{"sender":"YourBrand","body":"Order ready","recipients":["+447700900123"]}'
Python
import os, requests

env = os.environ
response = requests.post(
    env["SMS_API"] + "/campaigns",
    headers={
        "Authorization": "Bearer " + env["SMS_API_KEY"],
        "X-Client-Id": env["SMS_CLIENT_ID"],
        "Idempotency-Key": env["REQUEST_UUID"]
    },
    json={"sender": "YourBrand", "body": "Order ready",
          "recipients": ["+447700900123"]},
    timeout=30
)
response.raise_for_status()
print(response.json()["data"]["id"])
JavaScript · Node.js
const env = process.env;
const response = await fetch(env.SMS_API + "/campaigns", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Client-Id": env.SMS_CLIENT_ID,
    "Authorization": "Bearer " + env.SMS_API_KEY,
    "Idempotency-Key": env.REQUEST_UUID
  },
  body: JSON.stringify({ sender: "YourBrand",
    body: "Order ready", recipients: ["+447700900123"] })
});
if (!response.ok) throw new Error(String(response.status));
console.log((await response.json()).data.id);

Reporting & follow-up

What you can see

Admission returns a reference to track. Reports expose readiness, parts, cost and dispatch status. Individual application keys can be paused from the workspace.

Questions & answers

Frequently asked questions

Can each application use its own key?

Yes. Issue and scope a separate key for each application so you can pause or replace it independently.