Verify via WhatsApp

Verify via WhatsApp

Use WhatsApp messages to deliver one-time passwords (OTPs) to help with user authentication.

Send OTP messages to their devices through WhatsApp. This experience is similar to receiving SMS OTPs and even on Android phones, the OTP code can be retrieved directly from the English WhatsApp message, allowing users to receive the code without leaving the application.


Benefits of WhatsApp Verification

As a verification channel, it has the same advantages as SMS and is not affected by local carrier infrastructure. This means that WhatsApp messages can be received in areas where Wi-Fi is available but cellular signal is weak or non-existent (such as in remote areas or on airplanes). WhatsApp is typically faster than SMS and is end-to-end encrypted, providing additional security.

WhatsApp also offers more security advantages: each WhatsApp user is identified by their unique phone number provided when creating their account. WhatsApp uses its own set of powerful anti-fraud tools to verify these phone numbers. This means that you are outsourcing a part of your authentication to WhatsApp.

In many countries/regions, WhatsApp is cheaper than SMS and can help you save money without charging for unsent messages. In India, Indonesia, and South America, we recommend using WhatsApp as the preferred verification channel as it can increase your overall verification conversion rate and is cheaper.

Now use YCloud Verify, instead of building it from scratch, to start sending OTPs immediately with no message quantity limits or industry restrictions, sending through a pre-approved WhatsApp shared phone number.


Building WhatsApp Verification

  1. Use the send verification code API with the channel specified as WhatsApp.
  2. Verify the verification like any other channel. Refer to the API

WhatsApp Verification Pricing

The cost of sending messages varies depending on the country where the verification message is sent and there are no additional costs. WhatsApp only charges for successful messages, and you do not have to pay for failed or undelivered messages.

💰️ See WhatsApp Pricing for more details.


Best Practices for Implementing WhatsApp OTP

UI design

Using WhatsApp to send OTPs is a new way, and we offer some UI design suggestions:

Design SolutionApplicable Scenarios
Default to sending OTPs through WhatsApp
Immediately send through SMS after WhatsApp fails to send (most likely it's because the target phone number hasn't registered a personal WhatsApp account).
Your audience is primarily concentrated in countries/regions with high WhatsApp coverage, such as Indonesia, India, Brazil, and Colombia.
Provide button options for receiving OTP message channels, allowing users to choose their own channel for receiving OTPs.Your audience is in countries/regions where WhatsApp coverage is not high enough, or your application covers many countries/regions.
2880

OTP will be sent by default through WhatsApp. If sending fails, it will be instantly resent through SMS.

2880

Provide button options for receiving OTP message channels.


Checking if Users Have WhatsApp Installed

To improve the user experience and default to using WhatsApp, you can determine if the user has the WhatsApp application installed on the same device on which your application is running.
Here is an implementation example of WhatsApp detection for Android:

fun PackageManager.isPackageInstalled(packageName: String): Boolean {
  return try {
    getPackageInfo(packageName, PackageManager.GET_ACTIVITIES)
    true
  } catch (e: NameNotFoundException) {
    false
  }
}

fun isWhatsAppInstalled : Boolean() {
    val whatsAppPackageName = "com.whatsapp"
    val whatsAppBusinessPackageName = "com.whatsapp.w4b"
    return getPackageManager().isPackageInstalled(whatsAppPackageName) || getPackageManager().isPackageInstalled(whatsAppBusinessPackageName)
}

Q&A

Why is WhatsApp a good channel for OTP delivery?

Over the past few years, we have witnessed the rise of a new messaging channel: WhatsApp. It has over 2 billion users in 180 countries and is rapidly spreading to various countries/regions. Each WhatsApp user is identified by their unique phone number provided when creating a WhatsApp account, so this means that WhatsApp can directly replace SMS for all verification use cases, including registration, login, and transactions.

How does WhatsApp Verification work?

If you are familiar with the verification API used to send SMS OTPs, then simply change the required Channel parameter from SMS to WhatsApp with an API request. Like SMS, pre-approved OTP template messages are sent through a shared phone number maintained by YCloud.

Can I use my own brand and phone number to send WhatsApp OTP messages instead of YCloud's "generic sender"?

Currently, it is not possible to set your brand and phone number as the sender. However, your brand name will be included in the WhatsApp message body.
One of the main benefits of using YCloud's WhatsApp generic sender for Verify is the ability to use YCloud's WhatsApp shared number. It has the following benefits:

  • Starts at the highest message volume limit from the beginning
  • Avoids possible hindrances in WhatsApp's commercial policies, such as dating app and cryptocurrency products. However, you still need to comply with YCloud's acceptable use policy.

Which YCloud product should I use: Verify WhatsApp API or WhatsApp's Programmable Messaging API?

If your use case is OTP delivery, then we strongly recommend using YCloud Verify WhatsApp API as it is a solution specifically built for it. If you want to develop more personalized messaging use cases using WhatsApp, you can choose WhatsApp's Programmable Messaging API.