Skip to main content

Danh sách trường định nghĩa dữ liệu cơ hội

Endpoint

GET /api/v6.1/opportunity/define_fields

Cách gọi API

curl --location 'https://demo.getflycrm.com/api/v6.1/opportunity/define_fields?source_id=8' \
--header 'X-API-KEY: YOUR_API_KEY'

Tham số query

TrườngKiểuBắt buộcMô tả
source_idintegerKhôngID chiến dịch (campaign_id) — lọc trường theo chiến dịch cụ thể
fieldsstringKhôngDanh sách trường cần trả về, phân cách bởi dấu phẩy
pageintegerKhôngSố trang (mặc định: 1)
limitintegerKhôngSố bản ghi mỗi trang (mặc định: 20)

Phản hồi mẫu

{
"data": [
{
"id": 12,
"source_type": 1,
"source_id": 8,
"field_name": "budget",
"field_label": "Ngân sách",
"field_htmltype": "numericinput",
"field_datatype": "decimal",
"field_order": 1,
"field_requirenotnull": 0,
"field_hidden": 0,
"check_duplicate": 0,
"invalid": 0
},
{
"id": 13,
"source_type": 1,
"source_id": 8,
"field_name": "channel",
"field_label": "Kênh tiếp cận",
"field_htmltype": "select",
"field_datatype": "varchar",
"field_order": 2,
"field_requirenotnull": 0,
"field_hidden": 0,
"check_duplicate": 0,
"invalid": 0,
"define_field_lists": [
{ "id": 1, "list_value": "Facebook" },
{ "id": 2, "list_value": "Zalo" },
{ "id": 3, "list_value": "Website" }
]
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 2
}
}

Ghi chú

  • source_type luôn bằng 1 (tương ứng với Campaign/Cơ hội).
  • source_id là ID chiến dịch chứa các trường này.
  • Trường dạng select hoặc checkbox sẽ có thêm mảng define_field_lists chứa các lựa chọn.