eSMS for Developers
Đăng nhập
EN - eSMS for Developers
EN - eSMS for Developers
  • Overview
    • Getting started
    • Mechanism
    • Access to the API information
  • eSMS API
    • Send SMS API
      • Send OTP/Customer care message
      • Send adveritising message
      • Send message via Zalo
      • Send message via Viber
      • Send fixed number with cheap price
      • Send multi-channel message via Zalo and SMS
      • Send personized message via Zalo
      • Send Zalo message Consulting in text form
      • Send Zalo message with attached photo
      • Send Zalo message Consulting button
      • Send Zalo Trading message
      • Send Zalo messages to request user's information
      • Send Journey ZNS message
      • Send auto-generated SMS
      • The multichannel auto-generated OTP
    • Retrive and register functions
      • Get balance
      • Get the message status
      • Get SMS by SMSID
      • Get message details
      • Get list registered brandnames
      • Get list customer care templates
      • Summary your customer care submit
      • Summary your advertising submit
      • Get list OA
      • Get list templates of OA
      • Summary Zalo message
      • Get the daily quota of OA
      • Get rating information of Zalo users
      • Check the OA quality
      • Get list Zalo's followers
      • Get callback data
      • Get Zalo template details
      • Purchase OA package
      • Registering the Zalo template
      • Registering SMS template
    • Other APIs
      • Send customer care message using GET
      • Send customer care message using POST X-Form
      • Send customer care message using POST TEXT
      • Send fixed number using GET
      • Send advertising message using POST TEXT
      • Send Zalo message (old version)
      • Send Zalo message using POST X-FORM
      • Send Zalo message full template
      • Send Viber message using GET
      • Check code
    • Svoucher Connect
      • Connect to shortcode service
    • Voice
      • Create voice OTP call
      • Create an auto-call using template
      • Create a call from recording file
      • Get voice call status
    • Table of error codes
    • Test environment ( Sandbox)
    • Callback Url
Powered by GitBook
On this page
  1. eSMS API
  2. Send SMS API

Send personized message via Zalo

PreviousSend multi-channel message via Zalo and SMSNextSend Zalo message Consulting in text form

Last updated 2 months ago

This endpoint is used for sending SMS by batch (1 request for multiple SMS) via Zalo with shared or personized content/properties.

It is ideal to send any kind of massive personalized announcement.

HTTP request

POST

  • Content Type: application/json

  • Response Type: application/json

curl --location 'https://rest.esms.vn/MainService.svc/json/Send_zns_bulk_v4_post_json/' \
--header 'Content-Type: application/json' \
--data '{
    "ApiKey": "{{ApiKey}}",
    "SecretKey": "{{SecretKey}}",
    "campaignid": "Chiến dịch 1",
    "OAID": "4097311281936189049",
    "TempID": "267247",
    "Sandbox": "0",
    "CallbackUrl": "https://esms.vn/webhook/",
    "Data": [
        {
            "Phone": "0901888484",
            "RequestId": "96accf59-0c41-4bc7-a5c1",
            "Params": [ "Chị A", "Gội đầu", "KH001", "19/03/2025" ]
        },
        {
            "Phone": "0918238965",
            "RequestId": "96accf59-0c41-4bc7-a5c2",
            "Params": [ "Chị B", "Uốn", "KH002", "19/03/2025" ]
        },
        {
            "Phone": "0765418062",
            "RequestId": "96accf59-0c41-4bc7-a5c3",
            "Params": [ "Chị C", "Nhuộm", "KH003", "19/03/2025" ]
        }
    ]
}'
  • Request body

Paramter
Type
Required
Description

ApiKey

string

Your API Key.

SecretKey

string

Your Secret Key.

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.

Data

Array

An array of objects containing information about each message you want to send. Note: The array has a maximum size of 500 elements.

Data: Phone

string

The phone number of receivers.

Data: RequestId

string

Partner Message ID, used to check whether this ID has been previously received by the esms system. Ex: RequestId=123456.

Data: Params

string

The values that need to pass according to the template variables.

Giá trị cần truyền cho các biến trong Template

*Note:

  1. The values must be placed in the correct order with the registered template.

  2. If the parameter is duplicated, just place one.

SendDate

string

Scheduler 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

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.

CallbackUrl

string


  • Response:


{
    "CodeResult": "100",
    "Message": "Sucess",
    "TotalSuccess": 2,
    "detail": [
        {
            "CodeResult": "100",
            "Phone": "{Phone}",
            "SMSID": "a037b928-cb7e-4bfc-bdf9-0286318163aa264"
        },
        {
            "CodeResult": "100",
            "Phone": "{Phone}",
            "SMSID": "b83ff06e-8989-4b0d-818e-795b96699e86264"
        }
    ]
}

Valid request.

{
    "CodeResult": "101",
    "CountRegenerate": 0,
    "ErrorMessage": "Authorize Failed"
}

Invalid credential.

{
    "CodeResult": "789",
    "CountRegenerate": 0,
    "ErrorMessage": "TemplateId is not config"
}

The template is not configured on your account and OA.

  • Response body

Parameter
Type
Description

CodeResult

string

Response code

Message

string

The error message if the request is invalid.

TotalSuccess

string

Number of successfully requests.

detail : CodeResult

string

The detail response code

detail : Phone

string

Phone number of receiver

detail : SMSID

string

The message id corresponding to the phone number.

  • Note: This API does not allow sending except for zns free wallet whether the account is enabled or not, zns free news will be reconciled at the end of the month.

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 . More details at .

The detail of error code can refer at .

Get the sample of code for programing languagues to use in Postman refer at .

https://rest.esms.vn/MainService.svc/json/Send_zns_bulk_v4_post_json/
Table of error codes
Link of code samples
here
here