You can now let your customers receive their login OTPs for your app/website, on WhatsApp. This can be a great way of ensuring better deliverability of OTPs as well as providing a more seamless login experience for your customers. 

Authentication Templates are specific message templates designed for authentication purposes, such as sending one-time passwords (OTPs) or verification codes.

To send these OTPs to customers on WhatsApp, you must use ‘Authentication templates’. 

 

Types of Authentication Template

1. Copy Code Authentication templates 

Copy code authentication templates allow you to send a one-time password or code along with a copy code button to your users. When a WhatsApp user taps the copy code button, the WhatsApp client copies the password or code to the device’s clipboard. The user can then switch to your app and paste the password or code into your app.

image2 4

2. 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.

One-tap autofill buttons are only supported on Android. If you send an authentication template to a WhatsApp user who is using a non-Android device, the WhatsApp client will display a copy code button instead.

To use one-tap autofill authentication templates, you will need to make code changes in your Android app, so that it can receive the code from the WhatsApp app (in the recipient’s phone). Know more about the code changes here.

image1 4

3. Zero-tap Authentication templates

Zero-tap authentication templates allow your users to receive one-time passwords or codes via WhatsApp without having to leave your app.

When a user in your app requests a password or code and you deliver it using a zero-tap authentication template, the WhatsApp client simply broadcasts the included password or code and your app can capture it immediately with a broadcast receiver.

Zero-tap is only supported on Android. If you send a zero-tap authentication template to a WhatsApp user who is using a non-Android device, the WhatsApp client will display a copy code button instead.

To use zero-tap authentication templates, you will need to make code changes in your Android app, so that it can receive the code from the WhatsApp app (in the recipient’s phone). Know more about the code changes here.


How to create Authentication Templates?

As of now, to create Authentication templates, you will need to open the Template Manager in your Facebook Business account. However, we are soon going to allow creation of Authentication Templates from your Interakt account directly. 

After having created the Authentication template in your Facebook Business account, make sure you come to the Templates page in your Interakt account & click on Sync. By doing this, the template will get synced into your Interakt account and you’ll then be able to send it via Interakt’s APIs. (note – After the sync, the authentication template might not show up in the list of templates on the interface. However, if the sync is completed, you can assume that the template has got synced into Interakt. We are working on correcting this inconsistency.)

 

How to send Authentication Templates?

As of now, you can send Authentication templates to your customers via Interakt’s Send Template API.

Make sure that you send the same auth code in both the body and button values (as shown in the below curl). Also, please make sure that the auth code is less than or equal to 15 characters.

  curl --location 'api.interakt.ai/v1/public/message/' \
--header 'Authorization: Basic <SECRET_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "countryCode": "+91",
    "phoneNumber": "9028883545",
    "callbackData": "some text here",
    "type": "Template",
    "template": {
        "name": "itk_auth_one_tap",
        "languageCode": "en",
        "bodyValues": [
            "LIPSUM"
        ],
        "buttonValues": {
            "0": [
                "LIPSUM"
            ]
        }
    }
}
  

How to get delivery stats of Authentication Templates?

 

This can be done in 2 ways:

1. Either subscribe to Interakt’s Webhooks for delivery stats of messages sent via API

2. Create an API campaign & include the campaign id in the above send template API call → this will ensure that the delivery stats are displayed in the Interakt campaigns interface.

 

Pricing of Authentication Templates

 

If you send an Authentication template to your customer, a new Authentication conversation is started, which is chargeable as per the rates given here.