Skip to main content

Danh sách người dùng

Endpoint: GET /api/v6.1/users

Mô tả: API dùng để lấy danh sách người dùng. API hỗ trợ lọc theo email và số điện thoại.


Yêu cầu

Phương thức: GET

Headers:

X-API-KEY: <api-key-của-bạn>

Query Parameters

1. Tham số chung

  • fields (tùy chọn): Danh sách các trường cần lấy, phân cách bằng dấu phẩy (,).

    Ví dụ:

    user_id,contact_name,user_name,dept_id,dept_name,email,contact_mobile,extensions
  • offset (tùy chọn): Vị trí bắt đầu lấy dữ liệu (phân trang).

  • limit (tùy chọn): Số lượng bản ghi tối đa trả về.


2. Filtering (lọc dữ liệu)

Tham sốMô tả
filtering[email:contains]Lọc user theo email (chứa chuỗi)
filtering[contact_mobile:contains]Lọc user theo số điện thoại (chứa chuỗi)

Phản hồi

Trạng thái: 200 OK

Cấu trúc phản hồi

{
"data": [
{
"user_id": 1,
"contact_id": 1,
"contact_name": "Nguyen Van A",
"user_name": "example_user",
"dept_id": 2,
"dept_name": "Phòng kinh doanh",
"email": "[email protected]",
"contact_mobile": "0900000000",
"extensions": {
"FTI": "10145"
}
}
],
"offset": 0,
"limited": false
}

Mô tả các trường

TrườngKiểu dữ liệuMô tả
user_idintegerID user
contact_idintegerID contact liên kết với user
contact_namestringTên đầy đủ của user
user_namestringTên đăng nhập
dept_idintegerID phòng ban
dept_namestringTên phòng ban
emailstringEmail user
contact_mobilestringSố điện thoại liên hệ
extensionsobjectThông tin mở rộng (ví dụ: FTI, mã tổng đài…)

Ví dụ cURL

curl --location --globoff 'https://<ten-mien>/api/v6.1/users?fields=user_id,contact_name,user_name,dept_id,dept_name,email,contact_mobile,extensions&filtering[valid]=1&filtering[email:contains]=ts' \
--header 'X-API-KEY: <api-key>'

Xử lý lỗi

Mã lỗiMô tả
401Không được xác thực – sai hoặc thiếu API key
500Lỗi hệ thống