Skip to content

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.

First SMS

  1. Create an API key in Developer → API Key. See Authentication.
  2. POST /v1/sms with an approved sender and type TRANS.
  3. Store data[0].messageId.
  4. Subscribe to SMS delivery reports.
POST
/v1/sms
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

  1. Create the template and wait until it is Approved. Create templates.
  2. Send with type template and the approved templateName.
  3. Keep messageId for WhatsApp webhooks.
POST
/v1/whatsapp
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

  1. POST /v1/verify with configId and to.
  2. Store data from the response as verifyId.
  3. POST /v1/verify/validate with that verifyId and the PIN the user typed.
POST
/v1/verify
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

  1. Use an RCS-capable destination and a dashboard botId.
  2. POST /v1/rcs with an approved templateName.
  3. Match RCS webhooks using messageId.
POST
/v1/rcs
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

  1. On every successful send, persist messageId.
  2. Configure the channel webhook in the dashboard. Event map.
  3. 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.

Was this page helpful?