One-Tap Autofill Authentication Templates

One-tap autofill authentication templates allow you to send a one-time password or code along with an one-tap autofill button to your users. When a WhatsApp user taps the autofill button, the WhatsApp client triggers an activity which opens your app and delivers it the password or code.

Template Creation

You can use the WABA API to create One-tap autofill authentication templates. Alternatively, you can also create it using the WhatsApp Business Manager.

Use the create template endpoint and assemble the components in the request:

The base-url should be https://waba-v2.360dialog.io for Cloud API and https://waba.360dialog.io for On-Premise.

If you are using On-Premise API, remember that it is being discontinued by Meta. No new signups will be allowed with this type of integration from May 15, 2024.

Numbers registered before this date will still be supported, but should start planning a change of hosting type as soon as possible.

POST [base-url]/v1/configs/templates

The message template name field is limited to 512 characters. The message template content field is limited to 1024 characters.

Headers

NameTypeDescription

D360-API-KEY

string

Request Body

NameTypeDescription

name*

string

components*

array[objects]

Array of objects that describe the components that make up the template.

category*

string

Allowed values: AUTHENTICATION

language*

string

Post Body

{
  "name": "<TEMPLATE_NAME>",
  "language": "<TEMPLATE_LANGUAGE>",
  "category": "authentication",
  "message_send_ttl_seconds": <TIME_T0_LIVE>, // Optional
  "components": [
    {
      "type": "body",
      "add_security_recommendation": <SECURITY_RECOMMENDATION> // Optional
    },
    {
      "type": "footer",
      "code_expiration_minutes": <CODE_EXPIRATION> // Optional
    },
    {
      "type": "buttons",
      "buttons": [
        {
          "type": "otp",
          "otp_type": "one_tap",
          "text": "<COPY_CODE_BUTTON_TEXT>",  // Optional
          "autofill_text": "<AUTOFILL_BUTTON_TEXT>", // Optional
          "package_name": "<PACKAGE_NAME>",
          "signature_hash": "<SIGNATURE_HASH>"
        }
      ]
    }
  ]
}

Note that in your template creation request the button type is designated as otp, but upon creation the button type will be set to url. You can confirm this by performing a GET request on a newly created authentication template and analyzing its components.

Properties

PlaceholderDescriptionExample Value

<AUTOFILL_BUTTON_TEXT>

String

Optional.

One-tap autofill button label text.

Maximum 25 characters.

If omitted, the autofill text will default to a pre-set value, localized to the template's language. For example, Autofill for English (US).

Autofill

<CODE_EXPIRATION>

Integer

Optional.

Indicates the number of minutes the password or code is valid.

If included, the code expiration warning and this value will be displayed in the delivered message. The button will be disabled in the delivered message the indicated number of minutes from when the message was sent.

If omitted, the code expiration warning will not be displayed in the delivered message. In addition, the button will be disabled 10 minutes from when the message was sent.

Minimum 1, maximum 90.

5

<COPY_CODE_BUTTON_TEXT>

String

Optional.

Copy code button label text.

If omitted, the text will default to a pre-set value localized to the template's language. For example, Copy Code for English (US).

If included, the authentication template message will display a copy code button with this text if the message fails the eligibility check.

Maximum 25 characters.

Copy Code

<PACKAGE_NAME>

String

Required.

Your Android app's package name.

com.example.myapplication

<SECURITY_RECOMMENDATION>

Boolean

Optional.

Set to true if you want the template to include the string, For your security, do not share this code. Set to false to exclude the string.

true

<SIGNATURE_HASH>

String

Required.

Your app signing key hash. See App Signing Key Hash below.

K8a%2FAINcGX7

<TEMPLATE_LANGUAGE>

String

Required.

Template language and locale code.

en_US

<TEMPLATE_NAME>

String

Required.

Template name.

Maximum 512 characters.

verification_code

<TIME_TO_LIVE>

Integer

Optional.

Authentication message time-to-live value, in seconds. See Time-To-Live .

60

Example Request

This example creates a template named "authentication_code_autofill_button" categorized as authentication with all optional text strings enabled and a one-tap autofill button.

{
  "name": "authentication_code_autofill_button",
  "language": "en_US",
  "category": "authentication",
  "message_send_ttl_seconds": 60,
  "components": [
      {
          "type": "body",
          "add_security_recommendation": true
      },
      {
          "type": "footer",
          "code_expiration_minutes": 10
      },
      {
          "type": "buttons",
          "buttons": [
              {
                  "type": "otp",
                  "otp_type": "one_tap",
                  "text": "Copy Code",
                  "autofill_text": "Autofill",
                  "package_name": "com.example.luckyshrub",
                  "signature_hash": "K8a%2FAINcGX7"
              }
          ]
      }
  ]
}'

Sending One-Tap Authentication Template Messages

See our Authentication Templates documentation to learn how to send it to customers.

Last updated