How to create SCG-WhatsApp OTP Template

One of the most common use cases for mobile messaging is the One Time Password (OTP). Large entities as banks and service companies that require a high level of security and user/customer authentication to provide their services in a secure manner use OTP in their authentication procedures.

 

A growing channel for mobile messaging communications and in some geographical areas an already mature and massive messaging option is WhatsApp.

It is easy to foresee the convergence and for that reason WhatsApp provides a template category for this use case: AUTHENTICATION.

 

This document provides information on how to create an AUTHENTICATION WhatsApp template using SCG APIs. Meta has predefined functionality for this template category and here we will provide examples on how to create an SCG WhatsApp template using this category for this specific use case.

 

The SCG-WhatsApp templates are the META regulated templates created to be used by the SCG API exclusively for the WhatsApp channel/type message. As an alternative for the SCG portal, the SCG API provides a way to manage SCG-WhatsApp templates by calling API methods directly.

 

Creating an OTP SCG-WhatsApp Template using the SCG API

SCG API call to create a SCG-WhatsApp AUTHENTICATION template:

We could use Postman to directly execute an SCG API call with a POST request to create SCG-WhatsApp template for OTP:

Postman POST - create WA OTP template.jpg

 

When executed, SCG API response looks like:

Postman POST - create WA OTP template - Response.jpg

 

The cURL command to create the SCG WhatsApp template is:

curl --location 'https://api.syniverse.com/scg-external-api/api/v1/messaging/external_message_templates/{WABA}' \
--header 'int-companyId: {your_scg_company}' \
--header 'int-appId: {your_scg_application}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {SCG_token}' \
--data '{
"language": "en_US",
"name": "da_test_072",
"category": "AUTHENTICATION",
"components": [
{
"type": "BODY",
"add_security_recommendation": true
},
{
"type": "FOOTER",
"code_expiration_minutes": 5
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "OTP",
"otp_type": "COPY_CODE",
"text": "Pass"
}]}]}'

 

To send the OTP message using the new SCG-WhatsApp template in Postman

Postman POST - WA OTP using the template.jpg

 

The mobile device will get the OTP messages that looks like the below image:

OTP message in device.jpg

This template includes the Button functionality to COPY de OTP. When the consumer press the Pass button WhatsApp copies the OTP value to the mobile clipboard making it easy to paste the OTP code in the enterprise application.

 

When the consumer pressed the button, the WhatsApp will show:

Code Copied note.

OTP message in device copied.jpg

 

 

Was this article helpful?
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.