Send OTP

Send a One-Time Password (OTP) via WhatsApp.

GET
https://api.wawp.net/v2/auth/otp/send?chatId=201XXXXXXXXX&instance_id=YOUR_INSTANCE&access_token=YOUR_TOKEN&lang=ar&footer=Secured+by+Wawp

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/auth/otp/send endpoint
GETPOST

No query parameters required

This endpoint doesn't expect data in the URL.

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

URL Parameters

Passed in the URL query string
string

Your unique WhatsApp Instance ID

Example:
string

Your API Access Token

Example:
string

The recipient's valid phone number (International format).

Example:
string

Language code (Default: en).

Example:
string

Optional custom text to append to the message.

Example:

Request Samples

Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/auth/otp/send";
3const params = new URLSearchParams({
4 "instance_id": "YOUR_INSTANCE",
5 "access_token": "YOUR_TOKEN",
6 "chatId": "201XXXXXXXXX",
7 "lang": "ar",
8 "footer": "Secured by Wawp"
9}).toString();
10
11
12fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
13 method: "GET",
14 headers: { "Content-Type": "application/json" },
15
16})
17 .then(async (response) => {
18 if (response.ok) {
19 const data = await response.json();
20 console.log("Success:", data);
21 return data;
22 }
23
24 // Error Handling
25 if (response.status === 401) {
26 console.error("Error 401: Unauthorized - Invalid access_token");
27 }
28 if (response.status === 429) {
29 console.error("Error 429: Rate Limit Exceeded - Recipient protection");
30 }
31
32 const errorText = await response.text();
33 console.error(`Error ${response.status}: ${errorText}`);
34 })
35 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 35, Col 1javascript

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

OTP sent successfully
application/json
string *
string *
number *
string *

Example

{
"code": "success",
"message": "Verification code sent successfully",
"expires_in": 300,
"job_id": "send_123_456"
}
Unauthorized - Invalid access_token
Rate Limit Exceeded - Recipient protection
Previous TopicGet QR Image
Next TopicVerify OTP

Command Palette

Search for a command to run...