Sandbox - WhatsApp OTP

Send WhatsApp OTP

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

MsisdnDescriptionResponse
6282123060001Success Payload201 "OTP sent successfully" requested
6282123060002Bad Request400 "Validation error"
6282123060003Invalid Header401 "Authorization failed"
6282123060004insufficient quota403 "Quota insufficient"
6282123060005Blocked Msisdn409 "Msisdn invalid: msisdn has been blocked"
6282123060006Too Many Request429 "Too many request in the allowed time frame"
post/v1/whatsapp/otp/send/sandbox

Request

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

Headers

App-IDstring required
API-Keystring required

Request body

msisdnstring required

Destination Phone Number. Scenario is the only valid msisdn to use. Any other msisdn format will be marked as Invalid.

contentstring[] 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.

otpstring

Optional. Code generated by client.

challengestring

This value is a category. You can verify OTP based on the same challenge.

time_limitstring

Optional. Expiration time for verify OTP in seconds.

lang_codestring

Optional. Language code to send in a different language (need to be approved first too)

otp_lengthstring

Optional. Length of the OTP, do not send alongside self generated OTP code payload (payload otp)

callback_urlstring

Optional. This URL will be called by the server when the desired event will occur.

Example request

{
  "msisdn": "6282123060001",
  "content": [
    "Verihubs"
  ],
  "otp": "234123",
  "challenge": "update_account",
  "time_limit": "300",
  "lang_code": "en",
  "otp_length": "5",
  "callback_url": "https://your-url-callback.com"
}

Response

Successful Request

messagestring required

Message

otpstring required

Code received by destination number

msisdnstring required

destination number with international prefix country code

session_idstring required

Generated ID which associated with verification request

try_countinteger required

Shows count of send OTP attempts to destination number in the span of 10 minutes

Example response

{
  "message": "OTP sent successfully",
  "otp": "234123",
  "msisdn": "6282123060001",
  "session_id": "asddede-asdae234-34sfd3-fe234d",
  "try_count": 2
}

Changes

No recorded changes to this operation across all 1 revision of this API.