client.contacts quản lý các liên hệ — khách hàng tiềm năng, khách hàng, hoặc người dùng giao tiếp qua các kênh của bạn. Mỗi liên hệ có thể có các hội thoại, comments, files, và lịch sử hoạt động liên kết.
Schema
Trường Kiểu Mô tả object_namestring? Định danh loại đối tượng idstring ID duy nhất của liên hệ organization_idstring Tổ chức sở hữu liên hệ này display_namestring? Tên hiển thị của liên hệ emailstring? Địa chỉ email phone_numberstring? Số điện thoại avatar_urlstring? URL ảnh đại diện created_atstring ISO 8601 thời gian tạo updated_atstring ISO 8601 thời gian cập nhật
Trường Kiểu Bắt buộc Mô tả namestring Cập nhật tên hiển thị emailstring Cập nhật địa chỉ email phonestring Cập nhật số điện thoại
Trường Kiểu Mô tả _idstring ID duy nhất của comment textstring? Nội dung comment created_atstring? ISO 8601 thời gian tạo
Trường Kiểu Mô tả _idstring ID duy nhất của file namestring? Tên file urlstring? URL tải xuống sizenumber? Kích thước file (bytes)
Phương thức
Phương thức TypeScript Python Mô tả Danh sách listlistDanh sách liên hệ có phân trang Lấy getgetLấy liên hệ theo ID Cập nhật updateupdateCập nhật trường liên hệ Tìm kiếm searchsearchTìm kiếm toàn văn trên các liên hệ Xuất CSV exportCsvexport_csvTải xuống tất cả liên hệ dưới dạng CSV Lấy hội thoại getConversationsget_conversationsDanh sách hội thoại của liên hệ Lấy comment getCommentsget_commentsDanh sách comments nội bộ trên liên hệ Lấy file getFilesget_filesDanh sách files đính kèm với liên hệ Lấy hoạt động getActivitiesget_activitiesNhật ký hoạt động hội thoại Tải lên avatar uploadAvatarupload_contactsTải lên file cho liên hệ (avatar / import file) Danh sách thông báo listNotificationslist_notificationsDanh sách thông báo cho người dùng hiện tại Đánh dấu thông báo đã đọc markNotificationsReadmark_notifications_readĐánh dấu thông báo đã đọc Bỏ qua thông báo dismissNotificationdismiss_notificationBỏ qua một thông báo Bỏ qua tất cả thông báo dismissAllNotificationsdismiss_all_notificationsXóa tất cả thông báo
list / list
const page = await client . contacts . list ( { limit: 50 , skip: 0 } );
for ( const contact of page . data ) {
console . log (contact . id , contact . display_name , contact . email );
page = client.contacts. list ( limit = 50 , skip = 0 )
for contact in page. get ( " data " , [] ):
print ( contact [ " id " ] , contact. get ( " display_name " ) , contact. get ( " email " ))
search / search
const results = await client . contacts . search ( {
results = client.contacts. search ( " alice@example.com " )
update / update
const contact = await client . contacts . update ( " contact_id " , {
email: " alice@example.com " ,
contact = client.contacts. update ( " contact_id " , {
" email " : " alice@example.com " ,
getConversations / get_conversations
const conversations = await client . contacts . getConversations ( " contact_id " , {
channelTypes: " whatsapp,web " ,
conversations = client.contacts. get_conversations (
channel_types = " whatsapp,web " ,
const comments = await client . contacts . getComments ( " contact_id " , {
comments = client.contacts. get_comments ( " contact_id " , limit = 20 , skip = 0 )
getActivities / get_activities
Trả về nhật ký hoạt động cho một hội thoại liên kết với liên hệ này.
const activities = await client . contacts . getActivities ( " conversation_id " );
activities = client.contacts. get_activities ( " conversation_id " )
listNotifications / list_notifications
const page = await client . contacts . listNotifications ( { limit: 20 , skip: 0 } );
for ( const n of page . data ) {
page = client.contacts. list_notifications ( limit = 20 , skip = 0 )
markNotificationsRead / mark_notifications_read
await client . contacts . markNotificationsRead ([ " notif_id_1 " , " notif_id_2 " ]);
client.contacts. mark_notifications_read ()
const formData = new FormData ();
formData . append ( " file " , avatarBlob, " avatar.png " );
const result = await client . contacts . uploadAvatar (formData);
with open ( " avatar.png " , " rb " ) as f:
result = client.contacts. upload_contacts ( files = { " file " : f} )