Lấy thông tin trạng thái tin nhắn

API cho phép đối tác truy xuất trạng thái của thông báo.

HTTP request

URL: https://zns.api.gobysend.com/api/message/status Method: GET Content Type: application/json Response Type: application/json

Example request

curl
-X GET
-H "Content-Type: application/json" 
"https://zns.api.gobysend.com/api/message/status?message_id=message_id"

Tham số header

Tham số

Kiểu dữ liệu

Tính bắt buộc

Mô tả

string

yes

Đoạn mã cần truyền vào để xác minh quyền sử dụng API. Xem thêm tài liệu tham khảo

Tham số

Tham số

Kiểu dữ liệu

Tính bắt buộc

Mô tả

message_id

string

yes

ID của thông báo cần lấy thông tin trạng thái.

Example response

{
   "message": "Success",
   "data": {
       "delivery_time": "1600328011517",
       "message": "The message was delivered to the user's phone",
       "status": 1
   },
   "error": 0
}

Cấu trúc thuộc tính data

Thuộc tính

Kiểu dữ liệu

Mô tả

delivery_time

string

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

status

int

Trạng thái của thông báo.

message

string

Mô tả trạng thái thông báo. Các giá trị trả về:

  • -1: Tin nhắn không tồn tại.

  • 0: Tin nhắn đã được gửi tới nhà cung cấp dịch vụ (Zalo hoặc nhà mạng) nhưng chưa được gửi thành công tới thiết bị người dùng.

  • 1: Tin nhắn đã được nhà cung cấp dịch vụ gửi tới người dùng.

English version:

HTTP request

URL: https://zns.api.gobysend.com/api/message/status Method: GET Content Type: application/json Response Type: application/json

Example request

curl
-X GET
-H "Content-Type: application/json" 
"https://zns.api.gobysend.com/api/message/status?message_id=message_id"

Header param

Param

Data type

Compulsory

Description

string

yes

The token allows the OA agent to call the API. Reference document

Param

Param

Data type

Compulsory

Description

message_id

string

yes

The id of the message which get the status information.

Example response

{
   "message": "Success",
   "data": {
       "delivery_time": "1600328011517",
       "message": "The message was delivered to the user's phone",
       "status": 1
   },
   "error": 0
}

Data attribute structure

Attribute

Data type

Description

delivery_time

string

Time the user's device received the ZNS notification.

status

int

Notification status

message

string

Description of the notification status. Return values:

  • -1: The message does not exist.

  • 0: The message has been sent to the service provider (Zalo or carrier) but has not been successfully delivered to the user device.

  • 1: The message has been sent to the user by the service provider.

Last updated