Skip to content

👤 API: Hồ sơ khách hàng

Tóm tắt

Các API phục vụ panel Customer Profile trên giao diện agent. Dữ liệu chi tiết được lấy từ Bitrix theo nhu cầu — không nằm trong callback đăng nhập.

GET /api/method/login_with_haravan.customer_profile.get_ticket_customer_profile

Trả hồ sơ khách hàng cho ticket mà agent đang xem. Endpoint kiểm tra quyền đọc HD Ticket, lấy HD CustomerContact liên quan, sau đó gọi Bitrix server-side nếu cấu hình đang bật.

Tham số

Tham sốKiểuBắt buộcMô tả
ticketstringHD Ticket
refresh0/1Ép lấy lại dữ liệu từ Bitrix

Phản hồi

json
{
  "success": true,
  "data": {
    "customer": {},
    "contact": {},
    "haravan": [],
    "bitrix": {
      "enabled": true,
      "configured": true,
      "status": "matched",
      "company": {},
      "contact": {}
    }
  },
  "message": "Customer profile loaded."
}
TrườngMô tả
data.customerThông tin HD Customer
data.contactThông tin Contact
data.haravanDanh sách Haravan Account Link liên quan
data.bitrix.enabledTích hợp Bitrix có đang bật không
data.bitrix.statusTrạng thái match: matched, unmatched, error
data.bitrix.companyDữ liệu công ty từ Bitrix
data.bitrix.contactDữ liệu contact từ Bitrix

Bảo mật

Bitrix token/webhook URL không bao giờ được trả về browser. Mọi gọi Bitrix đều thực hiện server-side.

POST /api/method/login_with_haravan.customer_profile.refresh_customer_profile

Làm mới hồ sơ theo HD Customer và optional Contact. Gọi lại Bitrix để cập nhật dữ liệu mới nhất.

Tham số

Tham sốKiểuBắt buộcMô tả
hd_customerstringTên HD Customer
contactstringTên Contact (nếu muốn refresh cụ thể)