Recipes
Follow one path end to end. Each recipe uses the live host https://api.azmarq.com and the apikey header. Copy from the cURL tab if you will import into Postman.
Sends can incur charges. Use approved sender IDs, WhatsApp templates, and RCS bots from your dashboard.
First SMS
- Create an API key in Developer → API Key. See Authentication.
- POST
/v1/smswith an approvedsenderandtypeTRANS. - Store
data[0].messageId. - Subscribe to SMS delivery reports.
POST
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"
}'Success looks like this. error is null when the API accepted the send — not when the handset delivered.
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
}
Full variants: SMS reference. Same walkthrough as Quickstart.
WhatsApp template
- Create the template and wait until it is Approved. Create templates.
- Send with
typetemplateand the approvedtemplateName. - Keep
messageIdfor WhatsApp webhooks.
POST
curl --location --request POST 'https://api.azmarq.com/v1/whatsapp' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"from": "+91XXXXXXXXXX",
"campaignName": "api-test",
"to": "+91XXXXXXXXXX",
"templateName": "template_name",
"type": "template"
}'Session text/image/interactive messages only work inside the 24-hour window. See WhatsApp concepts.
OTP generate then verify
- POST
/v1/verifywithconfigIdandto. - Store
datafrom the response asverifyId. - POST
/v1/verify/validatewith thatverifyIdand the PIN the user typed.
POST
curl --location --request POST 'https://api.azmarq.com/v1/verify' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"configId": "a73cd9xe-XXXX-XXXX-XXXX-7f731bcf4y64",
"to": "91XXXXXXXXXX"
}'Response
{
"data": "33888968-XXXX-XXXX-XXXX-3010e0069668",
"error": null,
"message": "OTP Generated Successfully!"
}
Validate on Verify OTP.
RCS plain text
- Use an RCS-capable destination and a dashboard
botId. - POST
/v1/rcswith an approvedtemplateName. - Match RCS webhooks using
messageId.
POST
curl --location --request POST 'https://api.azmarq.com/v1/rcs' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"number": "+91XXXXXXXXXX",
"campaignName": "api-test",
"botId": "EXPOSE",
"type": "TRANS",
"templateName": "plane_text"
}'Cards and carousels: Send RCS.
Match a delivery report
- On every successful send, persist
messageId. - Configure the channel webhook in the dashboard. Event map.
- When a DLR arrives, join on
messageId— do not treat HTTP 200 on send as delivered.
Next: Errors if the send is rejected, or Omni SDK to stop writing HTTP by hand.