The multichannel auto-generated OTP

This endpoint is ideal for sending the OTP using multichannel mechanism.

The message will switch to SMS in case of the ZNS message gets failed with the same OTP.

HTTP request

POST https://rest.esms.vn/MainService.svc/json/SendMessageAutoGenCode_V5

  • Content Type: application/json

  • Response Type: application/json

curl --location 'https://rest.esms.vn/MainService.svc/json/SendMessageAutoGenCode_V5' \
--header 'Content-Type: application/json' \
--data '{
 "ApiKey": "{{ApiKey}}",
 "Phone": "{{Phone}}",
 "TimeAlive": "{{TimeAlive}}",
 "SecretKey": "{{SecretKey}}",
 "MultiChannelTempId": "{{MultiChannelTempId}}",
 "TypeId":"{{TypeId}}"
}'
  • Request body:

Parameter
Type
Required
Description

ApiKey

string

Your API Key.

Phone

string

The phone number of receiver.

TimeAlive

string

The time-to-live of the OTP. Unit of cal: minute Min: 2 Max: 15

SecretKey

string

Your Secret Key.

MultiChannelTempId

string

The Id vaue provided by ViHAT. To use this endpoint, you must have the OA and brandname. You have to send the ZNS and SMS template id to your saleman for creating.

TypeId

string

1: Only generate the OTP 2: Generate and send the OTP to phone.


  • Response:

{
    "CodeResult": "100",
    "CountRegenerate": 0,
    "SMSID": "d533459ee42b2b9525ba9eabf6a8156"
}

Valid request.

  • Response body

Parameter
Type
Description

CodeResult

string

Response code.

SMSID

string

The message id eSMS system.

ErrorMessage

string

The error message if the request is invalid.

Last updated