sendChecklist
Gửi checklist thay mặt tài khoản doanh nghiệp.
Giá trị trả về: Nếu thành công, trả về Message.
Tham số
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
business_connection_id | String | Có | ID kết nối doanh nghiệp |
chat_id | Integer or String | Có | ID chat hoặc @username |
checklist | InputChecklist | Có | Đối tượng JSON InputChecklist |
disable_notification | Boolean | Tùy chọn | Gửi không âm thanh |
protect_content | Boolean | Tùy chọn | Bảo vệ nội dung |
message_effect_id | String | Tùy chọn | ID hiệu ứng tin nhắn |
reply_parameters | ReplyParameters | Tùy chọn | Đối tượng JSON ReplyParameters |
reply_markup | InlineKeyboardMarkup | Tùy chọn | JSON: InlineKeyboardMarkup |
Ví dụ request
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendChecklist" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "BUSINESS_CONNECTION_ID",
"chat_id": 123456789,
"checklist": {
"title": "Today",
"tasks": [
{
"id": 1,
"text": "Write code"
}
]
}
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/sendChecklist",
json={
"business_connection_id": "BUSINESS_CONNECTION_ID",
"chat_id": 123456789,
"checklist": {
"title": "Today",
"tasks": [
{
"id": 1,
"text": "Write code"
}
]
}
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendChecklist`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "BUSINESS_CONNECTION_ID",
"chat_id": 123456789,
"checklist": {
"title": "Today",
"tasks": [
{
"id": 1,
"text": "Write code"
}
]
}
}),
});
console.log(await res.json());
Hướng dẫn từng bước: Cách tạo bot Telegram từ A đến Z: BotFather, token và tin nhắn đầu tiên
Phương thức liên quan
sendMessageGửi tin nhắn văn bản.forwardMessageChuyển tiếp một tin nhắn.forwardMessagesChuyển tiếp nhiều tin nhắn.copyMessageSao chép tin nhắn mà không kèm liên kết chuyển tiếp.copyMessagesSao chép nhiều tin nhắn.deleteMessageXóa một tin nhắn.deleteMessagesXóa nhiều tin nhắn.sendChatActionGửi hành động trong chat (đang nhập, v.v.).sendMessageDraftGửi bản nháp tin nhắn - bản xem trước tạm thời (Bot API 9.5+).sendContactGửi thông tin liên hệ.sendLocationGửi vị trí.sendVenueGửi địa điểm.