Chuyển tới nội dung chính

Thêm mới cơ hội

Endpoint

POST /api/v6.1/opportunity

Cách gọ API

curl --location 'https://linhpq.getflycrm.com/api/v6.1/opportunity' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'Cookie: v6_getflycrm_session=YOUR_SESSION_TOKEN' \
--data-raw '{
"campaign_code": "CD0008",
"account_code": "KH/2024/119270",
"account_name": "Tên khách hàng",
"account_phone": "0123456789",
"account_email": "[email protected]",
"contact_name": "Tên người liên hệ",
"contact_email": "[email protected]",
"contact_phone": "0987654321",
"recipient_username": "tennguoiduocphancong",
"define_fields": {
"text_input": "JPSKW",
"number_input": 12,
"text_area": "<p>hihi</p>",
"checkbox_don": 1,
"check_box_nhieu": [
"cb1",
"cb3"
],
"select_don": "sl2",
"select_nhieu": [
"sln2",
"sln3"
]
}
}'

Tham số trong body

TrườngKiểuBắt buộcMô tả
campaign_codestringMã chiến dịch liên quan
account_codestringKhôngMã khách hàng nếu có sẵn
account_namestringTên khách hàng
account_phonestringSố điện thoại khách hàng
account_emailstringKhôngEmail khách hàng
contact_namestringTên người liên hệ
contact_emailstringKhôngEmail liên hệ
contact_phonestringSố điện thoại liên hệ
recipient_usernamestringTên user nhận xử lý
define_fieldsstringCác trường dữ liệu tự đinh nghĩa (đối với select và check box số nhiều , có thể viết giá trị hoặc ID đều ghi nhận)

Phản hồi mẫu

{
"message": "Thêm mới thành công",
"data": {
"id": 2055057,
"define_fields": {
"text_input": "JPSKW",
"number_input": 12,
"text_area": "<p>hihi</p>",
"checkbox_don": 1,
"check_box_nhieu": [
1,
3
],
"select_don": 5,
"select_nhieu": [
8,
9
]
},
"updated_at": 1751013849,
"account_id": 11973,
"contact_id": 9753,
"opportunity_name": "Tên người liên hệ - Tên khách hàng",
"recipient": 2,
"create_user": 0,
"campaign_id": 8,
"amount": 0,
"probability": 0,
"receipt_date": 1751013849,
"opportunity_status": 31,
"created_at": 1751013849,
"opportunity_code": "CH2055057"
}
}