Chuyển đến nội dung

Bảng dữ liệu

client.boards là kho dữ liệu cốt lõi cho CRM pipelines — leads, deals, tasks, hoặc bất kỳ dữ liệu có cấu trúc nào. Mỗi board có các trường tùy chỉnh và items. Board cũng có thể liên kết với Knowledge Hub để tìm kiếm bằng AI.

Để xem hướng dẫn chi tiết, tham khảo DataBoards trong hướng dẫn SDK.


Schema

Board

TrườngKiểuMô tả
object_namestring?Định danh loại đối tượng
idstringID duy nhất của board
organization_idstringTổ chức sở hữu board này
namestringTên hiển thị của board
descriptionstring?Mô tả tùy chọn
workflow_idstring?ID workflow liên kết
hiddenboolean?Board có bị ẩn hay không
team_idsstring[]?Nhóm có quyền truy cập
created_atstringISO 8601 thời gian tạo
updated_atstringISO 8601 thời gian cập nhật

BoardField

TrườngKiểuMô tả
_idstringID duy nhất của trường
namestringTên hiển thị của trường
typestringKiểu trường (text, number, date, select, v.v.)
optionsobject[]?Cấu hình theo kiểu
requiredboolean?Trường có bắt buộc không

CreateBoardInput

TrườngKiểuBắt buộcMô tả
namestring✓Tên board
descriptionstringMô tả tùy chọn
typestringLoại board
fieldsobject[]Định nghĩa trường ban đầu
team_idsstring[]ID nhóm có quyền truy cập
show_idbooleanHiển thị cột ID

Phương thức

CRUD Board

Phương thứcTypeScriptPythonMô tả
Danh sách boardlistlistDanh sách tất cả board
Lấy boardgetgetLấy board theo ID
Tạo boardcreatecreateTạo board mới
Cập nhật boardupdateupdateCập nhật tên/mô tả board
Xóa boarddeletedeleteXóa board
Sắp xếp lại boardreorderreorderThay đổi thứ tự hiển thị

Nhập / Xuất

Phương thứcTypeScriptPythonMô tả
Xuất CSVexportCsvexport_csvXuất tất cả items dưới dạng CSV
Nhập CSVimportCsvimport_csvNhập items từ file CSV
Nhập ExcelimportExcelimport_excelNhập items từ file Excel
Lấy tiến độ importgetImportProgressget_import_progressKiểm tra trạng thái import đang chạy

Trường

Phương thứcTypeScriptPythonMô tả
Tạo trườngcreateFieldcreate_fieldThêm cột vào board
Cập nhật trườngupdateFieldupdate_fieldSửa cấu hình trường
Xóa trườngdeleteFielddelete_fieldXóa trường
Sắp xếp lại trườngreorderFieldsreorder_fieldsThay đổi thứ tự cột
Cập nhật hàng loạt trườngbulkUpdateFieldsbulk_update_fieldsCập nhật nhiều trường cùng lúc

Item

Phương thứcTypeScriptPythonMô tả
Danh sách itemlistItemslist_itemsDanh sách items có phân trang
Lấy itemgetItemget_itemLấy một item
Tạo itemcreateItemcreate_itemThêm item vào board
Cập nhật itemupdateItemupdate_itemCập nhật giá trị trường của item
Xóa itemdeleteItemdelete_itemXóa item
Xóa hàng loạtbulkDeleteItemsbulk_delete_itemsXóa nhiều items theo ID
Tìm kiếmsearchsearchTìm kiếm toàn văn trong board
Liên kết itemlinkItemslink_itemsLiên kết item với item board khác
Hủy liên kết itemunlinkItemsunlink_itemsXóa liên kết giữa các items

Segments

Phương thứcTypeScriptPythonMô tả
Danh sách segmentlistSegmentslist_segmentsDanh sách các view filter đã lưu
Tạo segmentcreateSegmentcreate_segmentLưu filter thành segment
Cập nhật segmentupdateSegmentupdate_segmentCập nhật filter của segment
Xóa segmentdeleteSegmentdelete_segmentXóa segment

list / list

const { data: boards } = await client.boards.list({ limit: 20 });
for (const board of boards) {
console.log(board.id, board.name);
}

create / create

const board = await client.boards.create({
name: "Enterprise Leads",
description: "Leads from the enterprise segment",
fields: [
{ name: "Company", type: "text" },
{ name: "Deal Size", type: "number" },
{ name: "Stage", type: "select", options: { choices: ["Prospect", "Qualified", "Closed"] } },
],
});

createItem / create_item

Truyền một mảng fields với mỗi phần tử có board_field_id (_id của BoardField) và value tương ứng.

const item = await client.boards.createItem("board_id", {
fields: [
{ board_field_id: "field_id_company", value: "Acme Corp" },
{ board_field_id: "field_id_deal_size", value: 50000 },
{ board_field_id: "field_id_stage", value: "Qualified" },
],
});

listItems / list_items

const page = await client.boards.listItems("board_id", { limit: 50, skip: 0 });
console.log(`${page.data.length} of ${page.total} items`);

Tìm kiếm toàn văn trong các items của board.

const results = await client.boards.search("board_id", {
q: "Acme",
limit: 20,
offset: 0,
});

importCsv / import_csv

const formData = new FormData();
formData.append("file", csvBlob, "leads.csv");
const result = await client.boards.importCsv("board_id", formData);
console.log(`Imported: ${result.imported}, Errors: ${result.errors}`);

createField / create_field

const field = await client.boards.createField("board_id", {
name: "Priority",
type: "select",
options: { choices: ["Low", "Medium", "High"] },
});