---
title: "Send WhatsApp OTP V2"
method: POST
path: "/v2/whatsapp/otp/send/sandbox"
tags: ["Sandbox - WhatsApp OTP"]
---

# Send WhatsApp OTP V2

`POST /v2/whatsapp/otp/send/sandbox`

## Request

- Base URL: `https://api.verihubs.com`
- URL: `https://api.verihubs.com/v2/whatsapp/otp/send/sandbox`
- Auth: none declared. Required headers: `App-ID`, `API-Key`

This method allows you to generate and send WhatsApp message containing one-time password in sandbox environment. 

#### Callback Description
Callbacks requires the url to be filled on payload. 
```
your-callback-url.com/callback
```
Example callback that we'll send
```
your-callback-url.com/callback?session_id=d0f5fb5c-2d50-4d3f-aea7-20018ab15806&status=1
```

To obtain the appropriate response, the payload input must adhere to the predetermined scenario. <br>
Input other than the scenario will be considered an Invalid Scenario <br>

#### Response & Status Description

Msisdn       | Description          | Response |
-----------|:---------------------|:-------------------------- |
6282123060001        | Success Payload      | 201 "OTP sent successfully" requested |
6282123060002        | Bad Request          | 400 "Validation error" |
6282123060003        | Invalid Header       |   401 "Authorization failed" |
6282123060004        | insufficient quota   | 403 "Quota insufficient" |
6282123060005        | Blocked Msisdn       | 409 "Msisdn invalid: msisdn has been blocked"
6282123060006        | Too Many Request     | 429 "Too many request in the allowed time frame"  |
|

## Headers

- `App-ID` string, required
- `API-Key` string, required

## Request body

- SendWhatsappOtp
  - `msisdn` string, required: Destination Phone Number. Scenario is the only valid msisdn to use. Any other msisdn format will be marked as Invalid.
  - `content` string[], required: String that will replaced variable from Template. For example 'This is your OTP Code {{1}}. Please use only in {{2}}'. If you put Registration in payload array 1, it will change variable {{1}} to Registration.
  - `otp` string: Optional. Code generated by client.
  - `challenge` string: This value is a category. You can verify OTP based on the same challenge.
  - `time_limit` string: Optional. Expiration time for verify OTP in seconds.
  - `lang_code` string: Optional. Language code to send in a different language (need to be approved first too)
  - `otp_length` string: Optional. Length of the OTP, do not send alongside self generated OTP code payload (payload otp)
  - `callback_url` string: Optional. This URL will be called by the server when the desired event will occur.

## Response `201`

Successful Request

- ResponseSendWhatsappOTP
  - `message` string, required: Message
  - `otp` string, required: Code received by destination number
  - `msisdn` string, required: destination number with international prefix country code
  - `session_id` string, required: Generated ID which associated with verification request
  - `try_count` integer, required: Shows count of send OTP attempts to destination number in the span of 10 minutes

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

---

[API](https://skmtc.dev/verihubs/apis/sandbox-whatsapp-api-documentation.md) - [All operations](https://skmtc.dev/verihubs/apis/sandbox-whatsapp-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/verihubs/apis/sandbox-whatsapp-api-documentation/revisions/80813f4bc2e7?raw)
