Bỏ qua tới nội dung

Nhóm

Nhóm chat: thông tin, thành viên, đổi tên, link mời. · 38 endpoint

Nhóm của tài khoản (từ DB, mới hoạt động trước)

GET/api/v1/accounts/{accountId}/groupsScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram.
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 200 · default 50
Số bản ghi tối đa (1–200)
offset
query · tuỳ chọn
integer
≥ 0 · default 0
Bỏ qua N bản ghi đầu
search
query · tuỳ chọn
string
max 200

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups" \
  -H "Authorization: Bearer dpk_xxx"

Tạo nhóm Zalo

POST/api/v1/accounts/{accountId}/groupsScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram.

Body (JSON)

name
bắt buộc
string
max 200
member_ids
bắt buộc
string[]
max 100 items

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","member_ids":[]}'

Thông tin nhóm từ kênh (thành viên, admin, cài đặt)

GET/api/v1/accounts/{accountId}/groups/{groupId}Scope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}" \
  -H "Authorization: Bearer dpk_xxx"

Đổi tên nhóm

PATCH/api/v1/accounts/{accountId}/groups/{groupId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

name
bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"string"}'

Giải tán nhóm (Zalo, cần là trưởng nhóm)

DELETE/api/v1/accounts/{accountId}/groups/{groupId}Scope: chat:manage

Không thể hoàn tác: bắt buộc ?confirm=true.

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)
confirm
query · tuỳ chọn
boolean
default false

Lệnh mẫu

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}" \
  -H "Authorization: Bearer dpk_xxx"

Thành viên nhóm (Zalo: danh sách đã lưu; Telegram: lấy từ kênh)

GET/api/v1/accounts/{accountId}/groups/{groupId}/membersScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 1000 · default 200

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/members" \
  -H "Authorization: Bearer dpk_xxx"

Thêm thành viên vào nhóm

POST/api/v1/accounts/{accountId}/groups/{groupId}/membersScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

user_ids
bắt buộc
string[]
max 50 items

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/members" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_ids":[]}'

Mời một thành viên ra khỏi nhóm

DELETE/api/v1/accounts/{accountId}/groups/{groupId}/members/{userId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
userId
path · bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/members/{userId}" \
  -H "Authorization: Bearer dpk_xxx"

Rời nhóm

POST/api/v1/accounts/{accountId}/groups/{groupId}/leaveScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/leave" \
  -H "Authorization: Bearer dpk_xxx"

Cấp quyền quản trị (Zalo: phó nhóm)

POST/api/v1/accounts/{accountId}/groups/{groupId}/adminsScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

user_id
bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/admins" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"string"}'

Gỡ quyền quản trị

DELETE/api/v1/accounts/{accountId}/groups/{groupId}/admins/{userId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
userId
path · bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/admins/{userId}" \
  -H "Authorization: Bearer dpk_xxx"

Chuyển quyền trưởng nhóm (Zalo)

POST/api/v1/accounts/{accountId}/groups/{groupId}/ownerScope: chat:manage

Bạn sẽ mất quyền trưởng nhóm: bắt buộc confirm: true.

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

user_id
bắt buộc
string
max 200
confirm
tuỳ chọn
boolean
default false

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/owner" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"string","confirm":false}'

Đổi ảnh nhóm (Zalo, Telegram)

PUT/api/v1/accounts/{accountId}/groups/{groupId}/avatarScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

upload_id
tuỳ chọn
string
library_uuid
tuỳ chọn
string
url
tuỳ chọn
string (uri)

Lệnh mẫu

bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/avatar" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"upload_id":"string","library_uuid":"string","url":"https://example.com/file.jpg"}'

Cài đặt nhóm Zalo (khoá đổi tên, duyệt thành viên, chỉ admin nhắn…)

GET/api/v1/accounts/{accountId}/groups/{groupId}/settingsScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/settings" \
  -H "Authorization: Bearer dpk_xxx"

Sửa cài đặt nhóm (Zalo; Facebook: chỉ join_approval)

PATCH/api/v1/accounts/{accountId}/groups/{groupId}/settingsScope: chat:manage

Chỉ gửi trường cần đổi; các cài đặt khác giữ nguyên (đọc cài đặt hiện tại trước, như bật/tắt từng mục trong app).

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

block_name
tuỳ chọn
boolean
sign_admin_msg
tuỳ chọn
boolean
set_topic_only
tuỳ chọn
boolean
enable_msg_history
tuỳ chọn
boolean
join_approval
tuỳ chọn
boolean
lock_create_post
tuỳ chọn
boolean
lock_create_poll
tuỳ chọn
boolean
lock_send_msg
tuỳ chọn
boolean
lock_view_member
tuỳ chọn
boolean

Lệnh mẫu

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/settings" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"join_approval":true,"lock_send_msg":false}'

Người xin vào nhóm đang chờ duyệt (Zalo)

GET/api/v1/accounts/{accountId}/groups/{groupId}/pending-membersScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/pending-members" \
  -H "Authorization: Bearer dpk_xxx"

Duyệt hoặc từ chối người xin vào nhóm (Zalo, Facebook)

POST/api/v1/accounts/{accountId}/groups/{groupId}/pending-members/reviewScope: chat:manage

Xử lý lần lượt từng người như nút "Duyệt tất cả" trong app; results cho biết từng người thành công hay lỗi.

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

user_ids
bắt buộc
string[]
max 100 items
approve
bắt buộc
boolean

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/pending-members/review" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_ids":[],"approve":false}'

Thành viên bị chặn khỏi nhóm (Zalo)

GET/api/v1/accounts/{accountId}/groups/{groupId}/blocked-membersScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/blocked-members" \
  -H "Authorization: Bearer dpk_xxx"

Chặn thành viên khỏi nhóm (Zalo; Telegram/Facebook: mời ra)

POST/api/v1/accounts/{accountId}/groups/{groupId}/blocked-membersScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

user_id
bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/blocked-members" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"user_id":"string"}'

Bỏ chặn thành viên nhóm (Zalo, Telegram bot)

DELETE/api/v1/accounts/{accountId}/groups/{groupId}/blocked-members/{userId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
userId
path · bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/blocked-members/{userId}" \
  -H "Authorization: Bearer dpk_xxx"

Xem nhóm từ link mời (Zalo): tên, số thành viên, trang thành viên

GET/api/v1/accounts/{accountId}/group-links/infoScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
ID tài khoản (accounts.zalo_id). Facebook dùng Facebook ID, Telegram dùng ID tài khoản Telegram.
link
query · bắt buộc
string
max 300
vd https://zalo.me/g/abcxyz
page
query · tuỳ chọn
integer
≥ 1 · ≤ 500 · default 1

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/group-links/info" \
  -H "Authorization: Bearer dpk_xxx"

Mời một người vào nhiều nhóm (Zalo)

POST/api/v1/accounts/{accountId}/users/{userId}/invite-to-groupsScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
userId
path · bắt buộc
string
max 200
ID người dùng trên kênh

Body (JSON)

group_ids
bắt buộc
string[]
max 50 items

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/invite-to-groups" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"group_ids":[]}'

Tạo bình chọn trong nhóm (Zalo, Facebook, Telegram bot)

POST/api/v1/accounts/{accountId}/groups/{groupId}/pollsScope: chat:send

Các tuỳ chọn multiple/allow_add_option/hide_vote_preview/anonymous/expires_at chỉ áp dụng cho Zalo.

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

question
bắt buộc
string
max 300
options
bắt buộc
string[]
max 20 items
multiple
tuỳ chọn
boolean
default false
allow_add_option
tuỳ chọn
boolean
default true
hide_vote_preview
tuỳ chọn
boolean
default false
anonymous
tuỳ chọn
boolean
default false
expires_at
tuỳ chọn
integer
≥ 0
Epoch ms; bỏ trống = không hết hạn

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/polls" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"question":"Chốt lịch họp tuần sau?","options":["Thứ 3","Thứ 5"],"multiple":false}'

Chi tiết bình chọn: lựa chọn, số phiếu, người bình chọn (Zalo)

GET/api/v1/accounts/{accountId}/polls/{pollId}Scope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
pollId
path · bắt buộc
string
max 200

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/polls/{pollId}" \
  -H "Authorization: Bearer dpk_xxx"

Bình chọn (Zalo, Facebook). Mảng rỗng = huỷ bình chọn (Zalo)

POST/api/v1/accounts/{accountId}/polls/{pollId}/votesScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
pollId
path · bắt buộc
string
max 200

Body (JSON)

option_ids
bắt buộc
integer | string[]
max 20 items

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/polls/{pollId}/votes" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"option_ids":[]}'

Khoá bình chọn (Zalo, người tạo)

POST/api/v1/accounts/{accountId}/polls/{pollId}/lockScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
pollId
path · bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/polls/{pollId}/lock" \
  -H "Authorization: Bearer dpk_xxx"

Thêm lựa chọn vào bình chọn (Zalo)

POST/api/v1/accounts/{accountId}/polls/{pollId}/optionsScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
pollId
path · bắt buộc
string
max 200

Body (JSON)

option
bắt buộc
string
max 200

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/polls/{pollId}/options" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"option":"string"}'

Tạo ghi chú nhóm (Zalo), tuỳ chọn ghim lên đầu

POST/api/v1/accounts/{accountId}/groups/{groupId}/notesScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

title
bắt buộc
string
max 2000
pin
tuỳ chọn
boolean
default false

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/notes" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"title":"string","pin":false}'

Sửa ghi chú nhóm (Zalo)

PATCH/api/v1/accounts/{accountId}/groups/{groupId}/notes/{noteId}Scope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
noteId
path · bắt buộc
string
max 200
topicId của ghi chú

Body (JSON)

title
bắt buộc
string
max 2000
pin
tuỳ chọn
boolean
default true

Lệnh mẫu

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/notes/{noteId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"title":"string","pin":true}'

Chủ đề (forum topic) của siêu nhóm Telegram

GET/api/v1/accounts/{accountId}/groups/{groupId}/topicsScope: chat:read

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/topics" \
  -H "Authorization: Bearer dpk_xxx"

Tạo chủ đề (Telegram)

POST/api/v1/accounts/{accountId}/groups/{groupId}/topicsScope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
ID nhóm (thread_id)

Body (JSON)

title
bắt buộc
string
max 128
icon_color
tuỳ chọn
integer
≥ 0 · ≤ 16777215
icon_emoji_id
tuỳ chọn
string
max 64

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/topics" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"title":"string","icon_color":0,"icon_emoji_id":"string"}'

Sửa / đóng / ghim chủ đề (Telegram)

PATCH/api/v1/accounts/{accountId}/groups/{groupId}/topics/{topicId}Scope: chat:manage

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
topicId
path · bắt buộc
string
max 200
ID topic (root message id)

Body (JSON)

title
tuỳ chọn
string
max 128
icon_emoji_id
tuỳ chọn
string
max 64
closed
tuỳ chọn
boolean
pinned
tuỳ chọn
boolean

Lệnh mẫu

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/topics/{topicId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"title":"string","icon_emoji_id":"string","closed":false}'

Tin mới nhất của một chủ đề, lấy trực tiếp từ Telegram

GET/api/v1/accounts/{accountId}/groups/{groupId}/topics/{topicId}/messagesScope: chat:read

Tin đã lưu trong Deplao đọc bằng GET …/conversations/{groupId}/messages?topic_id=.

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
topicId
path · bắt buộc
string
max 200
ID topic (root message id)
limit
query · tuỳ chọn
integer
≥ 1 · ≤ 100 · default 50

Lệnh mẫu

bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/topics/{topicId}/messages" \
  -H "Authorization: Bearer dpk_xxx"

Gửi tin vào chủ đề (Telegram): chữ hoặc một file

POST/api/v1/accounts/{accountId}/groups/{groupId}/topics/{topicId}/messagesScope: chat:send

Tham số

accountId
path · bắt buộc
string
max 200
groupId
path · bắt buộc
string
max 200
topicId
path · bắt buộc
string
max 200
ID topic (root message id)

Body (JSON)

text
tuỳ chọn
string
max 4096
Chữ; khi gửi kèm file thì là chú thích
upload_id
tuỳ chọn
string
library_uuid
tuỳ chọn
string
url
tuỳ chọn
string (uri)

Lệnh mẫu

bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/groups/{groupId}/topics/{topicId}/messages" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"text":"string","upload_id":"string","library_uuid":"string"}'