Updated on 2023-12-22 GMT+08:00

Querying the Corporate Directory

Description

This API is used by an enterprise user or administrator to query the corporate directory.

Debugging

You can debug this API in API Explorer.

Prototype

Table 1 Prototype

Request Method

GET

Request Address

/v1/usg/abs/users

Transport Protocol

HTTPS

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Location

Description

offset

No

Integer

Query

Query offset. If the value exceeds the maximum number of records available, records on the last page are returned.

Default value: 0.

limit

No

Integer

Query

Number of records to query.

Default value: 100

searchKey

No

String

Query

Search criteria. Fuzzy search by account, SIP number, name, mobile number, and email address is supported.

deptCode

No

String

Query

Department code.

maxLength: 32

minLength: 0

querySubDept

No

Boolean

Query

Whether to query users in lower-level departments.

Default value: true.

searchScope

No

String

Query

Search scope.

  • NORMAL_USER: common users. Common user data is returned. (In the response, the value of isHardTerminal is false and the value of type is NORMAL_USER.)
  • HARD_TERMINAL: hard terminal users. Response:

    Whiteboard users (In the response, the value of isHardTerminal is false and the value of type is WHITE_BOARD.)

    Hard terminal users (In the response, the value of isHardTerminal is true and the value of type is HARD_TERMINAL.)

    IdeaHub users (In the response, the value of isHardTerminal is false and the value of type is IDEA_HUB_MEMBER.)

  • ALL: all users.

    Default value: ALL.

X-Access-Token

Yes

String

Header

Authorization token. Use the value of accessToken in the response to the request for Authenticating an App ID.

X-Request-Id

No

String

Header

Request ID, which is used for fault tracing and locating. You are advised to use a UUID. If this parameter is not carried, a request ID is automatically generated.

Accept-Language

No

String

Header

Language. Values: zh-CN for Chinese (default) and en-US for English.

Status Codes

Table 3 Status codes

HTTP Status Code

Description

200

Operation successful.

400

Invalid parameters.

401

Authentication is not performed or fails.

403

Insufficient permissions.

500

Server exception.

Response Parameters

Table 4 Response parameters

Parameter

Type

Description

count

Integer

Total number of records.

limit

Integer

Number of records displayed per page.

Default value: 10.

offset

Integer

Number of the query start page. The value starts from 0.

data

Array of UserDTO objects

Enterprise user details.

Table 5 UserDTO data structure

Parameter

Type

Description

account

String

User account.

deptName

String

Department that the user belongs to.

description

String

User description.

email

String

Email address.

englishName

String

English name of the user.

hidePhone

Boolean

Whether to hide the user's mobile number. If the value is true, the mobile number of the user is not returned when other users query the user.

id

String

User ID.

isHardTerminal

Boolean

Whether the account is a hard terminal account.

NOTE:

This parameter will be discarded. Do not use it.

name

String

Name of the user.

number

String

SIP number.

phone

String

Mobile number.

signature

String

User signature.

statusCode

Integer

When user details are queried, the response varies depending on the scenario.

  • 0: If the query is successful and the user information has changed, the new user information is returned in the response.
  • 1: If the query is successful and the user information has not changed, only the user ID is returned in the response.
  • 2: The user does not exist.
  • 3: No permissions to query the user.

title

String

Job title.

type

String

User type.

  • NORMAL_USER: common user.
  • HARD_TERMINAL: hard terminal user.
  • WHITE_BOARD: third-party whiteboard.
  • HW_VISION_MEMBER: smart TV.
  • IDEA_HUB_MEMBER: IdeaHub user.

updateTime

Long

Time when the user information was last updated, in timestamp format.

vmrId

String

Personal meeting ID of the user.

deptCodes

Array of strings

Department code list.

Example Request

GET /v1/usg/abs/users
Connection: keep-alive
X-Access-Token: stbiQWNk96PwWeKsA32h81u9YSiK3xZhpNEU
Content-Type: application/json
Content-Length: 102
Host: api.meeting.huaweicloud.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)

Example Response

HTTP/1.1 200 
Date: Wed, 18 Dec 2019 06:20:40 GMT
Content-Type: application/json;charset=UTF-8
Connection: keep-alive
http_proxy_id: 1fd3a76bc862c7bc7f7c9b09bea87647
Server: api-gateway
X-Request-Id: 7f3dc39fd1af5f1f274641d46ed720ba

{
    "offset": 0,
    "limit": 100,
    "count": 1,
    "data": [
        {
            "id": "067f692ed2ce492182a44579f6bc82aa",
            "statusCode": 0,
            "account": "067f692ed2ce492182a44579f6bc82aa",
            "name": "TE30",
            "englishName": null,
            "email": null,
            "phone": null,
            "deptName": "wangyue",
            "number": "+99111283523475338",
            "signature": null,
            "title": null,
            "description": null,
            "vmrId": null,
            "updateTime": 1567405876353,
            "isHardTerminal": true,
            "hidePhone": false,
            "type": "HARD_TERMINAL",
            "deptCodes": [  
               "1"     
             ]
        }
    ]
}

Error Codes

If an error code starting with MMC or USG is returned when you use this API, rectify the fault by following the instructions provided in Huawei Cloud API Error Center.

Example cURL Command

curl -k -i -X GET -H 'X-Access-Token: stbiQWNk96PwWeKsA32h81u9YSiK3xZhpNEU' https://api.meeting.huaweicloud.com/v1/usg/abs/users