Send an SMS message to a destination number.
For the full technical reference, see the OpenAPI specification.
- URL:
/api/Services/send - Method:
POST
Ensure you include the following headers in your request:
Accept: application/jsonContent-Type: application/jsonAuthorization: Basic base64(username:password)
| Parameter | Type | Required | Description |
|---|---|---|---|
destination | string | Yes | Destination phone number in E.164 format (e.g. +401234567889) |
text | string | Yes | Message text to send |
reference | object | No | Tracking reference to correlate the SMS with your business logic. (see Reference Attribute) |
service | string | No | Service identifier (e.g. AUTHENTICATION, DIGITALSIGN) |
action | string | No | Action within the service (e.g. 2FA, PASSWORD_RESET) |
key | string | No | Custom tracking key (e.g. user ID, order ID) |
attemptCount | integer | No | Deprecated. No longer required and has no effect. |
detailed | boolean | No | Return detailed response including provider info (default: false) |
businessRelationId | string | No | Business Relation Identifier for One Platform. Overrides default business relation settings. |
webhook | object | No | Inline webhook configuration. See webhook configuration |
{
"destination": "+1234567890",
"text": "Your verification code is: 123456",
"reference": {
"service": "AUTHENTICATION",
"action": "2FA",
"key": "user-12345"
},
"detailed": true
}Success (200 OK):
{
"message": "0: Accepted for delivery",
"provider": "PROVIDER1",
"id": "7b8ef313-f1f2-4c4f-bffa-438c287ba9d8"
}Error (500 Internal Server Error):
{
"code": 8,
"message": "Wrong number",
"details" : null
}| Code | Description | Solution |
|---|---|---|
| 8 | Wrong destination number | Verify number format and country code |
| 56 | Invalid number | Check number validity with carrier |
| 59 | Invalid reference service | Use valid service identifier |
| 60 | Message blocked by anti-flooding | Reduce sending rate |
| 61 | Message in watchlist | The destination number is blocked by watchlist rules. It is not possible to send SMS to this number. If you believe this is an error, contact Namirial support. |
| 64 | SMS provider not available | Retry or contact support |
| 66 | Empty or missing message text | Ensure the text field is not empty |
| 74 | Message containing URL is denied | Contact support to configure the account to send URLs |
Authentication failures return HTTP 401 with error code 63.
| Code | Description | Solution |
|---|---|---|
| 63 | Missing basic authentication header | Include Authorization: Basic base64(username:password) header |
| 63 | Username or password not valid | Verify credentials are correct and account is active |
Example response:
{
"code": 63,
"message": "Username or password not valid",
"details": null
}See Authentication for setup instructions.
curl -X POST https://sms.namirialtsp.com/api/Services/send \
-u username:password \
-H "Content-Type: application/json" \
-d '{
"destination": "+1234567890",
"text": "Hello from SMS Gateway"
}'