v1

latestOpenAPI 3.0.22026-07-2432112226.7 KB
Sandbox - SMS OTP

Sandbox - Send OTP V2

SMS OTP version change is by introducing a new API version release.<br>

Version changes usually need to be applied immediately to the latest version, in order to get a better API usage experience than the previous version.<br>

The benefits you get if you use a newer version are as follows.

  • Decreasing processing time in API Request and Response
  • Improve feature in SMS: Blocking Request, Spam Check, Sequential Phone Number, and Blocked Numbers
  • Increase RPS in SMS (before 30rps to 50rps)
  • Better developer environment to support future developments
  • Improve logging and monitoring on our side
  • Improved dependencies and improved service stability<br>

This method helps you to generate and send sms containing one-time password to destination number<br>

The following table describes the msisdn option to be used as an input<br>

MsisdnDescriptionResponse
6282123060001Valid Phone number201 "OTP sent successfully"
6282123060002Msisdn invalid400 "Msisdn invalid: msisdn length should between 4-16 characters"
6282123060003Invalid Header401 "Authorization failed"
6282123060004Insufficient Quota403 "OTP testing quota is insufficient"
6282123060005Blocked Msisdn409 "Msisdn invalid: msisdn has been blocked"
6282123060006Too Many Request429 "Too many request in the allowed time frame"
post/v2/otp/send/sandbox

Headers

app-idstring required
api-keystring required

Request body

msisdnstring required

Destination Phone Number. You need to include international prefix number.

templatestring

Optional.Template to be send to destination number. Include $OTP in template for generated OTP.

otpstring

Optional. Code generated by client.

time_limitstring

Optional. Expiration time for verify OTP in seconds.

challengestring

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

callback_urlstring

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

Example request

{
  "msisdn": "6282123060001",
  "template": "This is your Verihubs OTP $OTP.",
  "otp": "234123",
  "time_limit": "300",
  "challenge": "update_account",
  "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.

segment_countinteger

Shows segmentation SMS where SMS with over 160 characters will be split into more than 1 segment.

Example response

{
  "message": "OTP sent successfully",
  "otp": "234123",
  "msisdn": "6282123060001",
  "session_id": "adwaww-wdwa-fegr-wrwr",
  "try_count": 2,
  "segment_count": 2
}