Send auto-generated SMS

This endpoint is ideal for sending the automatically generated OTP to the customer by brandname.

The OTP is generated randomly and handled by ViHAT.

HTTP request

GET https://rest.esms.vn/MainService.svc/json/SendMessageAutoGenCode_V4_get?Phone={Phone}&ApiKey={ApiKey}&SecretKey={SecretKey}&TimeAlive={TimeAlive}&NumCharOfCode={NumCharOfCode}&Brandname={Brandname}&Type=2&message={Content}

  • Response Type: application/json

curl --location --globoff 'https://rest.esms.vn/MainService.svc/json/SendMessageAutoGenCode_V4_get?Phone={{Phone}}&ApiKey={{ApiKey}}&SecretKey={{SecretKey}}&TimeAlive={{TimeAlive}}&NumCharOfCode={{NumCharOfCode}}&Brandname={{Brandname}}&Type=2&message={{Content}}&IsNumber={{IsNumber}}'
  • Request body

Parameter
Type
Required
Description

Phone

string

The phone number of receiver.

ApiKey

string

Your API Key.

SecretKey

string

Your Secret Key.

TimeAlive

string

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

NumCharOfCode

string

Number of characters in the OTP. Default is 6.

Brandname

string

The name of the sender is shown in the header of the customer's message. Pre-registration is required.

Type

string

2: Send customer care message

message

string

The content of message, you shoule place the {OTP} in your content that will contain the the generated OTP. Example: To send the message "12345 is your code." -> The content you should put is "{OTP} is your code."

IsNumber

string

0: mixed between digits and chars. 1: only digits.


  • 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