Passer au contenu

Services

Send WhatsApp messages to end users.

Send a WhatsApp message

Requête

Sends a WhatsApp message to the specified recipient using a pre-approved utility template. Supports body parameters, URL buttons, and an optional reference for tracking. See Send a message for details.

Sécurité
basicAuth and ApiKeyAuth
Corpsapplication/jsonobligatoire

WhatsApp message request

tostringobligatoire

Recipient phone number in E.164 format (e.g. +390000000000).

Exemple:"+390000000000"
languagestringobligatoire

Language code of the template to use (e.g. it, en). See supported languages. Falls back to the template's default language if not found.

Exemple:"it"
templateIdinteger, (int64), >= 0obligatoire

Identifier of the WhatsApp template to use.

Exemple:3
businessRelationIdstring or null

Optional business relation identifier for internal tracking.

lrastring or null

Local Registration Authority (LRA) identifier.

referenceobject(ReferenceService)

Optional reference object for tracking. See Reference Attribute for details.

bodyobject(BodyComponent)

Template body component with dynamic parameters. See Body component for details on how to use placeholders.

urlButtonsArray of objects or null(UrlButtonTypeComponent)

List of URL button components with dynamic URL paths.

curl -i -X POST \
  -u '<username>:<password>' \
  https://wa.namirialtsp.com/api/services/send \
  -H 'Content-Type: application/json' \
  -H 'X-Api-Key: YOUR_API_KEY_HERE' \
  -d '{
    "to": "+390000000000",
    "language": "it",
    "templateId": 3,
    "body": {
      "parameters": [
        {
          "text": "Rome"
        },
        {
          "text": "m.rossi"
        }
      ]
    },
    "urlButtons": [
      {
        "index": 0,
        "urlPath": "/my/url/path"
      }
    ],
    "reference": {
      "service": "DIGITALSIGN",
      "action": "AUTH",
      "key": "ext-key-001"
    }
  }'

Réponses

Message sent successfully.

Corpsapplication/json
messageIdstring

Unique identifier of the sent message.

Exemple:"3425151601"
Réponse
{ "messageId": "3425151601" }