Gửi ZNS

Lưu ý:

  • Đối với các API sử dụng cho Shop thì API_KEY: <api_key>. Thông tin base_url của Shop

  • Đối với các API sử dụng cho Partner thì API_KEY: <shop_key>. Thông tin base_url của Partner

SendZNS

post
Body
modestring · enumOptionalPossible values:
oa_idstring · int64Optional
phonestringOptional
sending_modestring · enumOptionalPossible values:
template_idintegerOptional
tracking_idstringOptional
Responses
200
A successful response
application/json
post
POST /SendZNS HTTP/1.1
Host: $BASE_URL.Zalo
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "mode": "unknown",
  "oa_id": "text",
  "phone": "text",
  "sending_mode": "unknown",
  "template_data": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "template_id": 1,
  "tracking_id": "text"
}
200

A successful response

{
  "campaign_id": "text",
  "created_at": "2025-08-02T16:16:32.819Z",
  "delivery_status": "unknown",
  "delivery_time": "2025-08-02T16:16:32.819Z",
  "enable_sms_on_zns_failure": true,
  "error_code": 1,
  "error_message": "text",
  "fee_main": 1,
  "fee_token": 1,
  "feedback": [
    "text"
  ],
  "id": "text",
  "is_charged": true,
  "is_development": true,
  "journey_id": "text",
  "msg_id": "text",
  "note": "text",
  "oa_id": "text",
  "phone": "text",
  "rate": 1,
  "request_time": "2025-08-02T16:16:32.819Z",
  "sent_time": "2025-08-02T16:16:32.819Z",
  "shop_id": "text",
  "sms": {
    "brandname": "text",
    "code": "text",
    "description": "text",
    "message": "text",
    "request_time": "2025-08-02T16:16:32.819Z",
    "send_time": "2025-08-02T16:16:32.819Z",
    "status": "text",
    "status_description": "text",
    "unicode": true
  },
  "status": "Z",
  "submit_time": "2025-08-02T16:16:32.819Z",
  "template_data": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "template_id": 1,
  "timeout": 1,
  "tracking_id": "text",
  "type": "unknown",
  "updated_at": "2025-08-02T16:16:32.819Z",
  "user_id": "text",
  "zl_user_id": "text"
}

Request:

curl --location '$BASE_URL.Zalo/SendZNS' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
  "mode": "unknown",
  "oa_id": "string",
  "phone": "string",
  "sending_mode": "unknown",
  "template_data": {
    "property1": "string",
    "property2": "string"
  },
  "template_id": "<int>",
  "tracking_id": "<string>"
}'

Response:

{
  "campaign_id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "delivery_status": "unknown",
  "delivery_time": "2019-08-24T14:15:22Z",
  "error_code": 0,
  "error_message": "string",
  "fee_main": 0,
  "fee_token": 0,
  "id": "string",
  "is_charged": true,
  "is_development": true,
  "journey_id": "string",
  "msg_id": "string",
  "oa_id": "string",
  "phone": "string",
  "sent_time": "2019-08-24T14:15:22Z",
  "sending_mode": "unknown",
  "shop_id": "string",
  "status": "Z",
  "template_data": {
    "property1": "string",
    "property2": "string"
  },
  "template_id": 0,
  "timeout": 0,
  "tracking_id": "string",
  "type": "unknown",
  "updated_at": "2019-08-24T14:15:22Z",
  "user_id": "string"
}

Cấu trúc body của request

Tham số
Kiểu dữ liệu
Mô tả

mode

string

Enum: "unknown" "development" development: Khi có nhu cầu gửi thử mẫu ZNS để kiểm tra trước khi gửi chính thức, bạn có thể gọi lệnh ZNS API ở chế độ development. Chế độ development chỉ hỗ trợ gửi thử mẫu ZNS đến quản trị viên của ứng dụng hoặc quản trị viên của OA.

Nếu tham số mode không được truyền, mặc định mode = unknown

oa_id

int64

ID của OA

template_id

int

ID của mẫu tin

sending_mode

string

Chế độ gửi:

Giá trị
Tên chế độ gửi
Mô tả

"unknown"

Không xác định

Không xác định

"default"

Gửi thường

Tin ZNS được gửi theo cơ chế thông thường

"tag3"

Gửi vượt hạn mức

Cơ chế cho phép OA gửi tin ZNS tag 3 vượt hạn mức Lưu ý: Chế độ Gửi vượt hạn mức (sending_mode = "tag3") chỉ áp dụng cho các OA được whitelist.

phone

string

Số điện thoại người nhận

template_data

object

Các thuộc tính của mẫu tin mà bạn đã đăng ký với Zalo

Lưu ý: Cấu trúc template_data được quy định riêng ứng với từng mẫu tin

tracking_id

string

Mã số đánh dấu lần gọi API của bạn, do bạn định nghĩa. Bạn có thể dùng tracking_id để đối soát mà không phụ thuộc vào message_id của eTelecom cung cấp.

Cấu trúc thuộc tính dữ liệu trả về

Tham số
Kiểu dữ liệu
Mô tả

id

string <int64>

ID tin nhắn trên hệ thống của eTelecom

shop_id

string <int64>

ID cửa hàng trên hệ thống của eTelecom

user_id

string <int64>

ID người gửi tin trên hệ thống của eTelecom

campaign_id

string <int64>

ID của chiến dịch

delivery_status

string

Unkown: Không xác định

Received: Đã nhận Seen: Đã xem

delivery_time

string<date-time>

Thời gian thiết bị của người dùng nhận được thông báo ZNS

error_code

int

Mã lỗi

error_message

string

Thông báo lỗi

fee_main

int

Phí chính

fee_token

int

Phí khởi tạo token

is_charged

boolean

True: Tin ZNS được tính phí

False: Tin ZNS không được tính phí

is_development

boolean

True: Tin ZNS ở chế độ phát triển thử nghiệm

False: Tin ZNS không ở chế độ phát triển thử nghiệm

journey_id

string

ID của journey

msg_id

string

ID của thông báo ZNS

type

string

template: ZNS thường

journey: ZNS journey

status

string

Trạng thái Z: Mới tạo P: Enable N: Disable

template_data

object

Tham số tin nhắn

phone

string

Số điện thoại người nhận

sent_time

string<date-time>

Thời gian gửi thông báo ZNS

sending_mode

string

Bao gồm giá trị:

  • "unknown": Không xác định

  • "default": tin ZNS được gửi theo cơ chế thông thường

  • "tag3": tin ZNS được gửi theo cơ chế vượt hạn mức

template_id

integer

ID của mẫu tin

timeout

integer

Thời gian tối đa mà hệ thống xử lý yêu cầu

tracking_id

string

Mã số đánh dấu lần gọi API của bạn, do bạn định nghĩa. Bạn có thể dùng tracking_id để đối soát mà không phụ thuộc vào message_id của eTelecom cung cấp.

updated_at

string<date-time>

Ngày cập nhật

created_at

string<date-time>

Ngày tạo

Last updated