OTP Authentication

The WhatsApp OTP (One-Time Password) functionality in BizMagnets enables businesses to send OTPs via WhatsApp as part of user authentication, secure logins, or verification processes.

This guide will walk you through using the API to send OTPs efficiently through WhatsApp, leveraging BizMagnets platform and Meta's WhatsApp Business API.

Send OTP

POST https://api.bizmagnets.ai/otp/{{otp_config_uid}}/sendOTP

X-API-KEY - You can find the API keys under the settings.

This unique ID "5a706684-851f-3a27-b0d1-284155d8f862" is used for OTP tracking. You'll need this for the OTP verification step.

Headers

NameValue

Content-Type

application/json

X-API-KEY

{{api_key}}

Body

NameTypeDescription

name

string

The name of the recipient.

mobileNumber

string

The recipient's mobile number (without country code).

countryCode

string

The country code for the recipient's mobile number.

Response

{
  "id": "5a706684-851f-3a27-b0d1-284155d8f862",
  "message": "success"
}

Verify OTP

POST https://api.bizmagnets.ai/otp/{{otp_uid}}/verifyOTP

To verify the OTP entered by the user, you must use the same otp_uid returned in the response from the Send OTP request. This ensures that the OTP being verified matches the one generated for that specific request.

Headers

NameValue

Content-Type

application/json

X-API-KEY

{{api_key}}

Body

NameTypeDescription

otp

string

The OTP entered by the user for verification.

mobileNumber

string

The recipient's mobile number (without country code).

countryCode

string

The country code for the recipient's mobile number.

Response

{
  "id": "5a706684-851f-3a27-b0d1-284155d8f862",
  "message": "success"
}

Last updated