Send message via Zalo

This endpoint is used to send Zalo messages individually (1 request per message).

It is ideal to send single personalized messages for use-cases like notifications, alerting or marketing for example.

HTTP request

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

  • Content Type: application/json

  • Response Type: application/json

curl --location 'https://rest.esms.vn/MainService.svc/json/SendZaloMessage_V5_post/' \
--header 'Content-Type: application/json' \
--data '{
    "ApiKey": "{{ApiKey}}",
    "SecretKey": "{{SecretKey}}",
    "OAID": "{{OAID}}",
    "Phone": "{{Phone}}",
    "TempData": [
        {
            "key": "{{key1}}",
            "value": "{{value1}}"
        },
        {
            "key": "{{key2}}",
            "value": "{{value2}}"
        }
    ],
    "SendDate": "{{SendDate}}",
    "TempID": "{{TempID}}",
    "campaignid": "{{Campaignid}}",
    "Sandbox": "{{Sandbox}}",
    "CallbackUrl": "{{CallbackUrl}}"
}'
  • Request body

Parameter
Type
Required
Description

Phone

string

The phone number of receivers.

ApiKey

string

Your API Key.

SecretKey

string

Your Secret Key.

OAID

string

Zalo OA Id is the Zalo Official Account Id of the organization. It can be obtained by accessing to the Zalo administrator page.

Note: Pre-registration is required.

TempData

Json object

The dynamic json object of the template that is registered at Zalo. The template data structure is specified separatedly for each teamplate.

SendDate

string

Schedule the time when the message to the receiver. If it's empty, the message will be instantly sent to the receiver. Format: yyyy-mm-dd hh:MM:ss

TempID

string

The ID of template for the OA that is registered and provided by eSMS at Zalo to partner. Each template will have a specified structure of body.

campaignid

string

The campaign name of request

Sandbox

string

Sandbox option value (default is 0): 1: For testing purpose to verify the validation of the request. Message is not charged and sent to the receiver. 0: Message will be processed to the receiver properly.

CallbackUrl

string

The webhook URL that will receive the status of message after it processed to the operator. It is used for determine whether the SMS is succcessfully delivered to the receiver or failed. See the sample request at here. More details at here.


  • Response:

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

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