SMS OTP

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>

Rate limit of 50 RPS is applied to SMS service. Verihubs also apply rate limit divided into several categories based on product. More explanation link<br>

Callback Description

When you want to use callback_url payload, you only need to put for example

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
PayloadDescription
session_idID of the specific message
statusLatest status of the request

Status Description

StatusDescriptionCondition
0RequestedSMS OTP has been requested.
1DeliveredSMS OTP has been delivered to destination number. This status will be charged.
2VerifiedSMS OTP has been verified using verify OTP API. This status will be charged.
3Not VerifiedSMS OTP has not been verified after the time limit. This status will be charged.
4FailedOperator cannot send SMS OTP to destination number
5Request ErrorVerihubs cannot reach Operator
6RejectedRequest rejected due to Too Many Requests
7UndeliveredSMS OTP has not been delivered to destination number (response received from Operator). This status will be charged.
8No Delivery ReportDelivered without Delivery Report from Operator after certain period. This status will be charged.
9BlockedDestination Number has been blocked by Verihubs's system
post/v2/otp/send

Request

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

Headers

App-IDstring required
API-Keystring required

Request body

msisdnstring required

Destination Phone Number. You need to include the international prefix number and also find your local prefix number here.

templatestring

Optional.Template to be send to destination number. In the template, you must mention the brand name according to the Sender ID and 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": "62839102839",
  "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.

segment_countinteger

Segment Count is the number of SMS segmentation which is calculated by the GSM-7 and UTF-16 encoding system based on the SMS content sent. This segment count becomes a reference for calculating the cost of using SMS services. More explanation link

Example response

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

Changes