SMS
Send SMS over HTTP using one endpoint for most variants. Extra fields change behaviour (unicode, flash, template id, short URL). Delivery receipts are webhooks, not the send response.
$API_BASE_URL is https://api.azmarq.com. Replace YOUR_API_KEY with the apikey header. See Authentication. Store messageId from the response to match SMS delivery reports.
What you can send
- Single and bulk SMS
- OTP SMS (
typeOTP) - Unicode SMS
- Flash SMS
- Template SMS (including DLT
templateId) - SMS with a shortened URL
type selects the route: TRANS (transactional), PROMO (promotional), OTP.
Base URL
https://api.azmarq.com/v1/smsHeaders
- Name
Content-Type- Type
- string
- Description
application/json
- Name
apikey- Type
- string
- Description
Dashboard API key. See Authentication.
Send Single Message
Send one SMS to a single destination. This is the same request as Quickstart.
Required Attribute
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
Route Type
Use TRANS for Transactional type,
Use PROMO for Promotional type,
Use OTP for OTP type.
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "TRANS"
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"totalCount": 1,
"message": "Message Sent Successfully!",
"error": null
}
Send OTP SMS
Send an OTP over the OTP route. Set type to OTP. For generate-then-validate (the API creates the code), use Generate and Verify OTP instead.
Required Attributes
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
Route Type
Use TRANS for Transactional type,
Use PROMO for Promotional type,
Use OTP for OTP type.
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "OTP"
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"totalCount": 1,
"message": "Message Sent Successfully!",
"error": null
}
Send Bulk SMS
Send the same body to several destinations in one request. Put comma-separated MSISDNs in to. The response data array contains one messageId per recipient.
Required attributes
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
Route Type
Use TRANS for Transactional type,
Use PROMO for Promotional type,
Use OTP for OTP type.
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "TRANS"
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXX1",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
},
{
"recipient": "91XXXXXXXXX2",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:2"
},
{
"recipient": "91XXXXXXXXX3",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:3"
}
],
"totalCount": 3,
"message": "Message Sent Successfully!",
"error": null
}
Send SMS With Unicode
Set unicode to 1 when the message body contains non-GSM characters (Hindi, Arabic, emoji, and similar).
Required Attributes
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
Route Type
Use TRANS for Transactional type,
Use PROMO for Promotional type,
Use OTP for OTP type.
Optional Attributes
- Name
unicode- Type
- integer
- Description
To specify that themessage to be sent is in unicode format.
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "TRANS",
"unicode": 1
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"totalCount": 1,
"unicode": 1,
"message": "Message Sent Successfully!",
"error": null
}
Send Flash SMS
Flash SMS appears on the recipient's screen immediately and is not stored in the inbox by default. Set flash to 1.
Required Attributes
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
Route Type
Use TRANS for Transactional type,
Use PROMO for Promotional type,
Use OTP for OTP type.
Optional Attributes
- Name
flash- Type
- integer
- Description
Set to
1to send a flash SMS that appears on the lock screen instead of the inbox.
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "TRANS",
"flash": 1
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"flash": 1,
"totalCount": 1,
"message": "Message Sent Successfully!",
"error": null
}
Send Template SMS
Send using a pre-registered template. Pass templateId in addition to the usual send fields when the body is already registered on your account.
Required Attributes
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
Route Type
Use TRANS for Transactional type,
Use PROMO for Promotional type,
Use OTP for OTP type.
Optional Attributes
- Name
templateId- Type
- string
- Description
Unique ID of the template
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "TRANS",
"templateId": "templateId"
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"totalCount": 1,
"message": "Message Sent Successfully!",
"error": null
}
Send SMS With Template ID
Use /sms/template when variables in a registered template must be filled at send time. Pass those values in custom in the same order as the template placeholders. Use an empty array if the template has no variables.
Required Attributes
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
templateId- Type
- string
- Description
Unique ID of the template
- Name
type- Type
- string
- Description
TRANS
- Name
custom- Type
- object
- Description
If the template contains variables, pass a custom parameter value in the array with the number of variables present in the template data. Otherwise, pass the custom parameter with a blank array.
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms/template' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "AOCAPI",
"to": "91XXXXXXXXXX",
"templateId": "150716565XXXXXXXXXX",
"custom": [
"var1",
"var2"
],
"type": "TRANS"
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"totalCount": 1,
"message": "Message Sent Successfully!",
"error": null
}
Send SMS With Short URL
Shorten one or more destination URLs in the message. Put {SORT} in text where the short link should appear, and list the long URLs in shortenUrlData.targetUrl.
Required Attribute
- Name
sender- Type
- string
- Description
Approved sender ID (alphanumeric originator) for this traffic.
- Name
to- Type
- string
- Description
Recipient MSISDN with country code. For bulk, comma-separated numbers.
- Name
text- Type
- string
- Description
Message body to send.
- Name
type- Type
- string
- Description
TRANS
- Name
shortenUrlData- Type
- object
- Description
This object contains information related to URL shortening functionality. It is designed to enable or configure the shortening of a target URL using the provided options.
Optional Attributes
Request
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "senderName",
"to": "91XXXXXXXXXX",
"text": "Thank you for contacting https://az2.in/SENDER/{SORT}",
"type": "TRANS",
"shortenUrlData": {
"shortenUrl": true,
"targetUrl": [
"http://5az.me"
]
}
}'Response
{
"id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
"data": [
{
"recipient": "91XXXXXXXXXX",
"messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
}
],
"totalCount": 1,
"message": "Message Sent Successfully!",
"error": null
}
Delivery reports
HTTP 200 on send means the API accepted the message. Operator delivery (DELIVERED, FAILED, PENDING) arrives later as a DLR webhook.
Configure DLR Push under Message app → Utility Manager, then see the placeholder list and POST/GET bodies on Webhooks. Match incoming messageId to the messageId in the send response.