sendsms

Overview

  • API URL:/api/v1/zoloz/globalsms/sendsms
  • API Description: This interface is used to send specified SMS content to a designated phone number. Currently, it only supports sending SMS to numbers in certain regions. Please communicate with ZOLOZ contacts for specific details.

Billing Description

When the sendsms API call is successful and resultStatus =S, an SMS fee is charged.

SMS Type

Billing Description

Pure English SMS (GSM-7 encoding)

  • Letters, numbers, and symbols are all counted as one character each.
  • An SMS with a length of up to 160 characters is billed as one SMS. If the SMS exceeds 160 characters, it is considered a long SMS and is split into multiple messages for billing, with each segment containing up to 153 characters.

Other Language SMS (UCS-2 encoding)

  • Chinese characters, letters, numbers, and symbols are all counted as one character each.
  • An SMS with a length of up to 70 characters is billed as one SMS. If the SMS exceeds 70 characters, it is considered a long SMS and is split into multiple messages for billing, with each segment containing up to 67 characters.

Request parameters

Field name

Data type

Max Length

Default Value

Description

Example

mobile

String

20

-

Required. The phone number receiving the SMS. The format is the international country code followed by the phone number.

"6221245567****"

message

String

2000

-

Required. SMS Content.

"123456 is your verification code. Don't share it with anyone."

bizType

String

-

-

Required. The values are as follows:

  • 1: Verification SMS.
  • 2: Marketing SMS, any message other than verification codes is considered a marketing SMS.

Note: Please ensure that the correct bizType is provided. An incorrect bizType may affect the proper sending of the SMS.

"1"

senderId

String

256

Default platform senderId

Optional. The sender displayed when the user receives the SMS. Please communicate with ZOLOZ contacts to register the senderId. The registration time is estimated to be 2-4 weeks.

Note: If there is no senderId during customer testing, the default senderId configured on the platform will be used.

"U****e"

Response parameters

Field name

Data type

Description

Example

result

Result

Required. API response, including status, code, and message.

{

"resultStatus": "S", "resultCode": "SUCCESS", "resultMessage": "Success"

}

transactionId

String

Optional. The unique transaction ID generated by the ZOLOZ server. This ID will serve as an input parameter for the Global SMS querysms API request.

Note: If an error occurs during the SMS sending process, such as invalid parameters, the transaction ID will not be returned.

"G0062000061MT20230325dAqiXBpQUbVB9h****"

Result

For different request results, different actions are to be performed. See the following for details:

  • If the value of the result.resultStatus is S, the ZOLOZ Global SMS sendsms API is invoked successfully.
  • If the value of the result.resultStatus is F, the invocation of the ZOLOZ Global SMS sendsms API fails. Check the error code and get more information about the possible reasons.

Common result codes

For the full list of common result codes, see the Common result codes section in the Error handling topic.

API-specific result codes

The following table shows the possible result codes that are specific for the ZOLOZ Global SMS sendsms API.

resultCode

resultSatus

Description

SUCCESS

S

Success

RETRY_LATER

F

Please retry after 10 seconds

CONTENT_TOO_LONG

F

The content is too long

INVALID_PHONE_NUMBER

F

Invalid phone number, please check the phone number format

INVALID_PHONE_NUMBER_QUANTITY

F

Invalid phone number quantity, please check the phone number quantity

SENDERID_TOO_LONG

F

SenderId is too long

INVALID_CONTENT

F

The content is invaild

INVALID_CONTENT_OR_OTP

F

The content or the OTP is invalid

FREQUENCY_LIMIT_DAY

F

The specific phone number cannot be sent more than ten times on the same day

QUANTITY_LIMIT_DAY

F

Sending quantity limit for the single number or the account

CONTENT_INCONSISTENT

F

The content is inconsistent

MERCHANT_INFO_MISSING

F

Merchant info missing

EXTERNAL_ERROR

F

External error

ILLEGAL_STATE

F

Illegal state

PARAM_ERROR

F

Param error

UNKNOWN_EXCEPTION

F

Unknown exception

Sample

Request Sample

copy
{
  "mobile": "6221245567****",
  "message": "123456 is your verification code. Don't share it with anyone.",
  "bizType": "1",
  "senderId": "U****e"
}

Response Sample

copy
{
  "result": {
    "resultCode": "SUCCESS",
    "resultMessage": "Success",
    "resultStatus": "S"
  }
  "transactionId": "G0062000061MT20230325dAqiXBpQUbVB9h****"
}