Comment on page
Hàm gửi tin Zalo Tư Vấn dạng Button
- HTTP request URL: http://rest.esms.vn/MainService.svc/json/SendZaloFollowerMessage_V5_post_json/ Method: POST Content Type: application/json
curl --location --request POST 'http://rest.esms.vn/MainService.svc/json/SendZaloFollowerMessage_V5_post_json/' \
--header 'Content-Type: text/plain' \
--header 'Cookie: ASP.NET_SessionId=asfgp2dj1kt4kbg1yzuo35ky' \
--data-raw '{
"ApiKey": "{ApiKey}",
"SecretKey": "{SecretKey}",
"OAID": "{OAID}",
"CallbackUrl": "{CallbackUrl}",
"Payload": {
"recipient": {
"user_id": "{user_id}"
},
"message": {
"text": "{text}",
"attachment": {
"type": "template",
"payload": {
"buttons": [
{
"title": "{title}",
"payload": {
"url": "{url}"
},
"type": "oa.open.url"
},
{
"title": "{title}",
"type": "oa.query.show",
"payload": "{payload}"
},
{
"title": "{title}",
"type": "oa.query.hide",
"payload": "{payload}"
},
{
"title": "{title}",
"type": "oa.open.sms",
"payload": {
"content": "{content}",
"phone_code": "{phone_code}"
}
},
{
"title": "{title}",
"type": "oa.open.phone",
"payload": {
"phone_code": "{phone_code}"
}
}
]
}
}
}
}
}'
- Thông tin request
Biến | Định nghĩa |
---|---|
ApiKey * | ApiKey của tài khoản. |
SecretKey * | Secretkey của tài khoản. |
OAID * | Zalo OA ID, là ID của trang Zalo Offical Account của doanh nghiệp. Doanh nghiệp cần đăng nhập vào trang quản trị của Zalo OA để lấy phần Zalo OA ID này.
Chú ý: sẽ phải đăng ký trước khi sử dụng. |
User_id * | Userid cần gửi đến, đây là userid của zalo. |
Content * | Nội dung tin nhắn
Lưu ý: Khi gửi dạng tin nhắn này khách hàng vui lòng liên hệ cho nhân viên kinh doanh để được hỗ trợ về content. |
Template_type * | Loại template |
Elements * |
|
CallbackUrl | eSMS sẽ trả về kết quả của tin nhắn này. |
- Kết quả trả về
{
"CodeResult": "100",
"CountRegenerate": 0,
"SMSID": "ebe101db-87cd-4285-b97b-6a7a90455ded30"
}
- Thông tin kết quả trả về
SMSID | ID của tin nhắn mới được tạo ra trên hệ thống eSMS. Dùng ID này để query lấy trạng thái tin nhắn. |