CRM
Khách hàng, tag CRM, ghi chú, chiến dịch gửi tin. · 13 endpoint
- GET/accounts/{accountId}/crm/contacts
- GET/accounts/{accountId}/crm/contacts/stats
- GET/accounts/{accountId}/crm/contacts/{contactId}
- PATCH/accounts/{accountId}/crm/contacts/{contactId}
- GET/accounts/{accountId}/crm/contacts/{contactId}/notes
- POST/accounts/{accountId}/crm/contacts/{contactId}/notes
- PATCH/accounts/{accountId}/crm/notes/{noteId}
- DELETE/accounts/{accountId}/crm/notes/{noteId}
- GET/accounts/{accountId}/crm/activity
- GET/accounts/{accountId}/bank-cards
- POST/accounts/{accountId}/bank-cards
- PATCH/accounts/{accountId}/bank-cards/{cardId}
- DELETE/accounts/{accountId}/bank-cards/{cardId}
Khách hàng (bạn bè, người lạ, nhóm) với bộ lọc như trang CRM
GET
/api/v1/accounts/{accountId}/crm/contactsScope: crm:readTham số
accountIdpath · 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. |
limitquery · tuỳ chọn | integer ≥ 1 · ≤ 200 · default 50 | Số bản ghi tối đa (1–200) |
offsetquery · tuỳ chọn | integer ≥ 0 · default 0 | Bỏ qua N bản ghi đầu |
searchquery · tuỳ chọn | string max 200 | |
typequery · tuỳ chọn | "all" | "friend" | "non_friend" | "group" default "all" | |
sort_byquery · tuỳ chọn | "name" | "last_message" default "last_message" | |
sort_dirquery · tuỳ chọn | "asc" | "desc" default "desc" |
Lệnh mẫu
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts" \
-H "Authorization: Bearer dpk_xxx"Thống kê khách hàng (tổng, bạn bè, ghi chú)
GET
/api/v1/accounts/{accountId}/crm/contacts/statsScope: crm:readTham số
accountIdpath · 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. |
Lệnh mẫu
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/stats" \
-H "Authorization: Bearer dpk_xxx"Hồ sơ khách: thông tin, nhãn, ghi chú, 5 tin gần nhất
GET
/api/v1/accounts/{accountId}/crm/contacts/{contactId}Scope: crm:readTham số
accountIdpath · bắt buộc | string max 200 | |
contactIdpath · bắt buộc | string max 200 |
Lệnh mẫu
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/{contactId}" \
-H "Authorization: Bearer dpk_xxx"Cập nhật số điện thoại / tên hiển thị / biệt danh (lưu trên Deplao)
PATCH
/api/v1/accounts/{accountId}/crm/contacts/{contactId}Scope: crm:writeTham số
accountIdpath · bắt buộc | string max 200 | |
contactIdpath · bắt buộc | string max 200 |
Body (JSON)
phonetuỳ chọn | string max 30 | |
display_nametuỳ chọn | string max 200 | |
aliastuỳ chọn | string max 100 |
Lệnh mẫu
bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/{contactId}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"phone":"string","display_name":"string","alias":"string"}'Ghi chú của khách
GET
/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notesScope: crm:readTham số
accountIdpath · bắt buộc | string max 200 | |
contactIdpath · bắt buộc | string max 200 |
Lệnh mẫu
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notes" \
-H "Authorization: Bearer dpk_xxx"Thêm ghi chú
POST
/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notesScope: crm:writeTham số
accountIdpath · bắt buộc | string max 200 | |
contactIdpath · bắt buộc | string max 200 |
Body (JSON)
contentbắt buộc | string max 10000 | |
topic_idtuỳ chọn | string |
Lệnh mẫu
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/contacts/{contactId}/notes" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"content":"string","topic_id":"string"}'Sửa ghi chú
PATCH
/api/v1/accounts/{accountId}/crm/notes/{noteId}Scope: crm:writeTham số
accountIdpath · bắt buộc | string max 200 | |
noteIdpath · bắt buộc | integer ≥ 1 |
Body (JSON)
contact_idbắt buộc | string max 200 | |
contentbắt buộc | string max 10000 |
Lệnh mẫu
bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/notes/{noteId}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"contact_id":"string","content":"string"}'Xoá ghi chú
DELETE
/api/v1/accounts/{accountId}/crm/notes/{noteId}Scope: crm:writeTham số
accountIdpath · bắt buộc | string max 200 | |
noteIdpath · bắt buộc | integer ≥ 1 |
Lệnh mẫu
bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/notes/{noteId}" \
-H "Authorization: Bearer dpk_xxx"Hoạt động CRM trong khoảng thời gian
GET
/api/v1/accounts/{accountId}/crm/activityScope: crm:readTham số
accountIdpath · 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. |
sincequery · bắt buộc | integer ≥ 0 | Epoch ms |
untilquery · tuỳ chọn | integer ≥ 0 |
Lệnh mẫu
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/crm/activity" \
-H "Authorization: Bearer dpk_xxx"Thẻ ngân hàng đã lưu để gửi cho khách
GET
/api/v1/accounts/{accountId}/bank-cardsScope: crm:readTham số
accountIdpath · 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. |
Lệnh mẫu
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/bank-cards" \
-H "Authorization: Bearer dpk_xxx"Lưu thẻ ngân hàng (để gửi nhanh cho khách)
POST
/api/v1/accounts/{accountId}/bank-cardsScope: crm:writeTham số
accountIdpath · 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)
bank_namebắt buộc | string max 100 | |
bin_bankbắt buộc | integer ≥ 100000 · ≤ 999999 | Mã BIN ngân hàng (6 số, vd 970436 = Vietcombank) |
account_numberbắt buộc | string max 40 | |
account_namebắt buộc | string max 100 | |
is_defaulttuỳ chọn | boolean default false |
Lệnh mẫu
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/bank-cards" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"bank_name":"Vietcombank","bin_bank":970436,"account_number":"0011001234567","account_name":"NGUYEN VAN A","is_default":true}'Sửa thẻ ngân hàng
PATCH
/api/v1/accounts/{accountId}/bank-cards/{cardId}Scope: crm:writeTham số
accountIdpath · bắt buộc | string max 200 | |
cardIdpath · bắt buộc | integer ≥ 1 |
Body (JSON)
bank_nametuỳ chọn | string max 100 | |
bin_banktuỳ chọn | integer ≥ 100000 · ≤ 999999 | |
account_numbertuỳ chọn | string max 40 | |
account_nametuỳ chọn | string max 100 | |
is_defaulttuỳ chọn | boolean |
Lệnh mẫu
bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/accounts/{accountId}/bank-cards/{cardId}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"bank_name":"string","bin_bank":100000,"account_number":"string"}'Xoá thẻ ngân hàng đã lưu
DELETE
/api/v1/accounts/{accountId}/bank-cards/{cardId}Scope: crm:writeTham số
accountIdpath · bắt buộc | string max 200 | |
cardIdpath · bắt buộc | integer ≥ 1 |
Lệnh mẫu
bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/bank-cards/{cardId}" \
-H "Authorization: Bearer dpk_xxx"