API Recipes: SMS, WhatsApp, OTP, and RCS
Search a walkthrough, then copy the cURL. Each recipe uses https://api.azmarq.com and the apikey header.
Sends can incur charges. Use approved sender IDs, WhatsApp templates, and RCS bots from your dashboard. $API_BASE_URL is https://api.azmarq.com. Authentication first if you do not have a key yet.
New to the API? Run Quickstart for the first SMS, then come back here for the other channels.
Host
https://api.azmarq.com
$API_BASE_URL for every send.
Auth
apikey
Header on every call. Not Bearer.
Recipes
5 walkthroughs
Live HTTP plus one webhook matching path.
Find a recipe
Showing 5 of 5.
POST /v1/sms
First SMS
Send one SMS, store messageId, then match SMS DLR.
Get ready: Approved sender ID, wallet credits, gateway type. India: DLT PE + template ID.
Open walkthrough →
POST /v1/whatsapp
WhatsApp template
Send an approved template. Session messages only inside the 24-hour window.
Get ready: Connected number (from), Meta-approved templateName, wallet credits.
Open walkthrough →
POST /v1/verify
OTP generate then verify
Generate returns verifyId. Validate with the PIN the user typed.
Get ready: OTP configId on the account and a destination to.
Open walkthrough →
POST /v1/rcs
RCS plain text
Send a branded RCS template. Match RCS webhooks on messageId.
Get ready: Approved botId and templateName. Optional capability check.
Open walkthrough →
Events DLR + inbound
Match a delivery report
HTTP 200 on send is not delivery. Join webhooks on messageId.
Get ready: Public HTTPS URL and a store keyed by messageId.
Open walkthrough →
First SMS
Get ready: wallet credits, Approved sender ID, gateway type (for example TRANSACTIONAL). India: DLT PE ID + template ID. What DLT is. GSM English is 160 characters (153 concatenated); Unicode regional languages are 70 (67). Normal and Unicode characters.
- Create an API key in Developer → API Key. See Authentication.
- POST
/v1/smswith an approvedsenderandtypeset to the gateway API code assigned to the account. - Store
data[0].messageId. - Subscribe to SMS delivery reports.
curl --location --request POST 'https://api.azmarq.com/v1/sms' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"sender": "AZMARQ",
"to": "91XXXXXXXXXX",
"text": "Hello World!",
"type": "TRANSACTIONAL"
}'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
}
If this fails: Errors. Full guide: SMS (Message App). Same walkthrough as Quickstart.
WhatsApp template
Get ready: connected WhatsApp number (from), Meta-Approved template (templateName), wallet credits. Pick the right category (authentication / utility / marketing). What a template is.
- Create the template and wait until it is Approved. Create templates.
- Send with
typetemplateand the approvedtemplateName. - Fill
componentsif the body has{'{{1}}'}placeholders — same order as the template. - Keep
messageIdfor WhatsApp webhooks.
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 after the customer messages you. Outside that window, use a template. Session window.
If Meta rejected the template, fix category or wording and resubmit — do not send the rejected name.
OTP generate then verify
Get ready: an OTP config (configId) on the account, a destination to, and a way to show the PIN (often SMS or WhatsApp on the same account).
- POST
/v1/verifywithconfigIdandto. - Store
datafrom the response asverifyId. - Deliver the PIN however your config is set (the generate call creates the code).
- POST
/v1/verify/validatewith thatverifyIdand the PIN the user typed.
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. Do not log the live PIN. If generate fails, check configId and wallet — this is not the SMS sender field.
RCS plain text
Get ready: RCS bot (botId), Approved template (templateName), credits. Optional: capability check on RCS Numbers. RCS.
- Use an RCS-capable destination and a dashboard
botId. - POST
/v1/rcswith an approvedtemplateName. - Match RCS webhooks using
messageId.
curl --location --request POST 'https://api.azmarq.com/v1/rcs' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY' \
--data-raw '{
"botId": "YOUR_BOT_ID",
"number": "91xxxxxxxxxx",
"templateName": "welcome_card",
"campaignName": "launch",
"content": [],
"meta": {}
}'Cards and carousels: RCS guide and Send RCS. If the handset is not RCS-capable, add a Fallback rule (SMS or WhatsApp) on compose.
Match a delivery report
Get ready: a public HTTPS URL, and a database keyed by messageId.
- On every successful send, persist
messageIdwith your own order or user id. - 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. - Ignore duplicate posts with the same id and status.
SMS DLR can be GET query or POST JSON depending on the configuration Method. WhatsApp uses message_status / message_received. RCS uses bot callbacks.
Next: Errors if the send is rejected, or Omni SDK to stop writing HTTP by hand.