Skip to content

Sending SMS

Senders, segments, languages and delivery tracking — what to know before sending an SMS in Mauritania and the region.

Choose a sender

The sender is the name your customer sees, for example KARAMPAY. It is registered country by country in the dashboard, under Senders: until it is approved in a country, sends to that country are refused.

Send

cURL
curl https://api.rassilo.ai/v1/messages \
  -H "Authorization: Bearer $RASSILO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Idempotency-Key: $(uuidgen)" \
  -d '{
    "channel": "sms",
    "to": "+22200000000",
    "body": "Votre code Karam Pay est 482913."
  }'
Node.js
// send.mjs
import { randomUUID } from 'node:crypto';

const response = await fetch('https://api.rassilo.ai/v1/messages', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RASSILO_API_KEY}`,
    'Content-Type': 'application/json',
    'X-Idempotency-Key': randomUUID(),
  },
  body: JSON.stringify({
    channel: 'sms',
    to: '+22200000000',
    body: 'Votre code Karam Pay est 482913.',
  }),
});

const message = await response.json();
console.log(message.provisionalId, message.status); // … submitted
Python
# send.py
import os
import uuid

import requests

response = requests.post(
    "https://api.rassilo.ai/v1/messages",
    headers={
        "Authorization": f"Bearer {os.environ['RASSILO_API_KEY']}",
        "X-Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "channel": "sms",
        "to": "+22200000000",
        "body": "Votre code Karam Pay est 482913.",
    },
)

message = response.json()
print(message["provisionalId"], message["status"])  # … submitted

Segments and languages

An SMS is billed per segment. Arabic and characters outside the GSM alphabet switch to Unicode, which makes a segment shorter. Each response gives the segment count (parts) and the encoding (bodyEncoding: GSM7 or UCS2).

EncodingOne segmentLong message, per segment
GSM-7160 characters153 characters
Unicode (UCS-2)70 characters67 characters

Delivery statuses

StatusMeaning
submittedSubmitted: the operator accepted the message. Not a delivery yet.
deliveredDelivered: the operator confirms it reached the phone. The only status that means delivered.
failedFailed: the message was not delivered.
delivery_unknownOutcome unknown: no delivery report 72 hours after submission. The message is not counted as delivered.