Gửi tin nhắn theo mẫu đính kèm danh sách
Quyền cần có: Quyền gửi tin và thông báo qua OA
HTTP request
URL: https://zns.api.gobysend.com/api/follower/message/send
Method: POST
Content Type: application/json
Response Type: text/json


Example request
curl
-X POST
-H "Content-Type: application/json" -d '{
"recipient": {
"user_id": "2468458835296117922"
},
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "list",
"elements": [
{
"title": "Official Account API",
"subtitle": "There Is No Limit To What You Can Accomplish Using Zalo",
"image_url": "https://stc-developers.zdn.vn/images/bg_1.jpg",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/official-account-api-147"
}
},
{
"title": "Article API",
"image_url": "https://stc-zaloprofile.zdn.vn/pc/v1/images/zalo_sharelogo.png",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/article-api-151"
}
},
{
"title": "Social API",
"image_url": "https://stc-zaloprofile.zdn.vn/pc/v1/images/zalo_sharelogo.png",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/social-api-4"
}
},
{
"title": "Shop API",
"image_url": "https://stc-zaloprofile.zdn.vn/pc/v1/images/zalo_sharelogo.png",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/shop-api-124"
}
}
]
}
}
}
}' "https://zns.api.gobysend.com/api/follower/message/send"
Tham số header
Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả
Cấu trúc body của request
Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả
recipient
object
yes
Thông tin người nhận
message
object
yes
Nội dung cần gửi
Cấu trúc thuộc tính recipient
Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả
user_id
string
yes
ID của người nhận (nhận được thông qua API lấy thông tin người quan tâm, API lấy danh sách người quan tâm)
Cấu trúc thuộc tính message
Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả
attachment
object
yes
Attachment cần gửi
Cấu trúc thuộc tính message.attachment
Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả
type
string
yes
Loại attachment.
Giá trị nhận vào bắt buộc:
type = template
payload
object
yes
Chứa payload của attachment muốn gửi
Cấu trúc thuộc tính message.attachment.payload
Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả
template_type
string
yes
Loại template.
Với template gửi thông báo theo mẫu đính kèm ảnh, giá trị nhận vào:
template_type = list
Tham khảo các template khác tại đây.
elements
array
yes
OA API hỗ trợ gửi thông báo theo 2 dạng danh sách:
List of elements: Tham khảo cấu trúc của element tại đây.
List of button (chỉ hỗ trợ với phiên bản mobile): Tham khảo cấu trúc của button tại đây.
Lưu ý:Cấu trúc element thay đổi tùy theo loại template. Với template danh sách, danh sách element bao gồm tối đa 5 phần tử.
Example respond
{
"data": {
"msg_id": "e6fa968f027"
},
"error": 0,
"message": "Success"
}
Cấu trúc thuộc tính data
Thuộc tính
Kiểu dữ liệu
Mô tả
msg_id
string
ID của thông báo
English version:
HTTP request
URL: https://zns.api.gobysend.com/api/follower/message/send
Method: POST
Content Type: application/json
Response Type: text/json
Example request
curl
-X POST
-H "Content-Type: application/json" -d '{
"recipient": {
"user_id": "2468458835296117922"
},
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "list",
"elements": [
{
"title": "Official Account API",
"subtitle": "There Is No Limit To What You Can Accomplish Using Zalo",
"image_url": "https://stc-developers.zdn.vn/images/bg_1.jpg",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/official-account-api-147"
}
},
{
"title": "Article API",
"image_url": "https://stc-zaloprofile.zdn.vn/pc/v1/images/zalo_sharelogo.png",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/article-api-151"
}
},
{
"title": "Social API",
"image_url": "https://stc-zaloprofile.zdn.vn/pc/v1/images/zalo_sharelogo.png",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/social-api-4"
}
},
{
"title": "Shop API",
"image_url": "https://stc-zaloprofile.zdn.vn/pc/v1/images/zalo_sharelogo.png",
"default_action": {
"type": "oa.open.url",
"url": "https://developers.zalo.me/docs/api/shop-api-124"
}
}
]
}
}
}
}' "https://zns.api.gobysend.com/api/follower/message/send"
Header param
Param
Data type
Compulsory
Description
Request body structure
Param
Data type
Compulsory
Description
recipient
object
yes
Recipient information
message
object
yes
Content to be sent
Recipient attribute structure
Param
Data type
Compulsory
Description
user_id
string
yes
User ID (received via API get follower information and follower list).
Message attribute structure
Param
Data type
Compulsory
Description
attachment
object
yes
Attachment needs to be sent.
Message.attachment attribute structure
Param
Data type
Compulsory
Description
type
string
yes
Attachment type. Required input value: type = template
payload
object
yes
Contains the payload of the attachment want to send.
Message.attachment.payload attribute structure
Param
Data type
Compulsory
Description
template_type
string
yes
Template type. With the template to send notifications according to the image attachment template, the input value: template_type = list
elements
array
yes
The OA API supports sending notifications in two types of lists: - List of elements: Refer to the structure of the element here. - List of button (only supported with mobile version): Refer to the structure of the button here. Note: The element structure varies depending on the type of template. With the list template, the element list includes up to 5 elements.
Example respond
{
"data": {
"msg_id": "e6fa968f027"
},
"error": 0,
"message": "Success"
}
Data attribute structure
Attribute
Data type
Description
msg_id
string
Notification ID
Last updated