온프레미스 API에 대한 지원을 중단합니다. 자세한 내용과 차세대 클라우드 API로 마이그레이션하는 방법을 알아보려면 온프레미스 API 지원 중단 문서를 참조하세요.

We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.

Sending Authentication Message Templates with One-Time Password Buttons

Follow these steps to send an authentication message with a one-time password button to a user who has requested one.

Step 1: Make POST Request to /messages

POST /v1/messages
{
    "to": "recipient_wa_id",
    "type": "template",
    "template": {
        "namespace": "your-namespace",
        "name": "your-template-name",
        "language": {
            "code": "your-language-and-locale-code",
            "policy": "deterministic"
        },
        "components": [
            {
                "type": "body",
                "parameters": [
                    {
                        "type": "text",
                        "text": "user-otp-code"
                    }
                ]
            },
            {
                "type": "button",
                "sub_type": "url",
                "index": 0,
                "parameters": [
                    {
                        "type": "text",
                        "text": "user-otp-code"
                    }
                ]
            }
        ]
    }
}

Parameters

  • Assign the user's one-time password or verification code to the text property (parameters.text) of both objects in the components array.

Step 2: Check the API Response

A successful response includes a messages object with an id.

{
  "messages": [{
    "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
  }]
}

An unsuccessful response contains an error object with an error string, error code and other information.

If a template is sent to an account that is incapable of receiving the template, the 1026 (ReceiverIncapable) error will be sent in the error object to the configured Webhook server.

See Error and Status Codes for more information on errors.

Legacy authentication templates

Attempting to send legacy authentication templates (templates without one-time password buttons) will return error code 1009 if variable values exceed 15 characters or contain links or emojis, or the template body component contains a link. Instead, create and use an authentication template that has a one-time password button.