Authentication
Every request needs two headers: your API key in Authorization: Bearer, and the current Unix time in seconds in X-Timestamp. Requests more than 5 minutes away from server time are rejected, which protects against replays.
# Send a verification code to a Syrian number curl -X POST https://sms.msgplus.tech/api/v1/send \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Timestamp: $(date +%s)" \ -H "Content-Type: application/json" \ -d '{ "sender_name": "MyApp", "template_id": 1, "numbers": ["963941234567"], "vars": { "code": "482916" } }'
API endpoints
| Endpoint | Purpose |
|---|---|
| POST /api/v1/send | Send a verification code to one or more numbers using an approved template |
| GET /api/v1/sms/{id}/status | Status of a sent message |
| POST /api/v1/sms/estimate | Estimate parts and cost before sending |
| GET /api/v1/balance | Remaining balance |
| GET /api/v1/templates | Templates available to your account |
| GET /api/v1/senders | Approved sender names |
Accepted Syrian number formats
The API accepts the common formats and converts them to the international 9639XXXXXXXX form before sending to Syriatel. Numbers may contain spaces, dashes or Arabic digits.
| Input | Result |
|---|---|
| 0991234567 | 963991234567 |
| +963991234567 | 963991234567 |
| 00963991234567 | 963991234567 |
| 991234567 | 963991234567 |
| +963 0991234567 | 963991234567 |
| 0781234567 | Rejected (not a Syrian mobile number) |
Encoding and message length
- Arabic messages use Unicode: 70 characters per single part, 67 per part for long messages.
- English messages use GSM-7: 160 characters per part.
- Cost = number of recipients × number of parts, so keep the code template short to stay in one part.
- Use POST /api/v1/sms/estimate to see the number of parts before sending.
Error codes
| HTTP | Reason |
|---|---|
| 202 | Accepted and queued for delivery |
| 400 | X-Timestamp header missing or too far from server time |
| 401 | API key missing or invalid |
| 403 | Sender name or template not approved for your account |
| 422 | Invalid number, missing template variables, or insufficient balance |
| 429 | Rate limit per minute exceeded |
Production tips
- Send from your server only; never put the API key in a mobile app.
- Keep your server clock synced (NTP) to avoid X-Timestamp errors.
- Test in sandbox mode first: simulated messages that are not sent and use no balance.
- Failed messages are refunded automatically, and you can follow every number in the SMS log.
Frequently asked questions
How do I send an SMS to a Syrian number with an API?
Send a POST request to https://sms.msgplus.tech/api/v1/send with your API key in Authorization and an X-Timestamp header, plus the sender name, template ID, number and variables.
Which Syrian number format does the API need?
Any common format: 09XXXXXXXX, +9639XXXXXXXX or 009639XXXXXXXX; MsgPlus converts it to 9639XXXXXXXX.
Does the API support Arabic messages?
Yes, in Unicode with 70 characters per single part.
Can I send to several numbers in one request?
Yes, the numbers field accepts a list.
Is there a test environment?
Yes, sandbox mode simulates sending without delivering messages or using balance.