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"
}'

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ý

Phản hồi mẫu

{
"message": "Thêm mới thành công",
"data": {
"id": 2055057,
"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"
}
}