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

Querying External Contacts

Description

This API is used by enterprise users (including administrators) to query external contacts of an enterprise or their own external contacts.

Debugging

You can debug this API in API Explorer.

URI

GET /v1/usg/abs/external-contacts

Table 1 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

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

Minimum value: 0

Default value: 0

limit

No

Integer

Number of records to query. Default value: 10.

Minimum value: 1

Maximum value: 500

Default value: 10

searchKey

No

String

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

Minimum length: 0

Maximum length: 1024

searchScope

No

String

Search scope. Default value: ALL.

  • PERSONAL: individual's external contacts.

  • CORP: enterprise's external contacts.

  • ALL: all external contacts.

Default value: ALL

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Access-Token

Yes

String

Access token. Use the value of accessToken returned by the API for Authenticating an App ID.

X-Request-Id

No

String

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

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

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

offset

Integer

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

limit

Integer

Number of records displayed per page. Default value: 10.

count

Integer

Total number of records.

data

Array of ExternalContactDTO objects

External contact details by page.

Table 4 ExternalContactDTO

Parameter

Type

Description

otherNumber

String

Other number.

NOTE:
  • The value must be prefixed with a country code.

  • When otherNumber is specified, otherNumberCountry must also be specified.

  • To clear the mobile number settings, leave otherNumberCountry and otherNumber empty.

Minimum length: 0

Maximum length: 32

otherNumberCountry

String

Country or region that the mobile number belongs to.

Minimum length: 0

Maximum length: 32

country

String

Country or region that the mobile number belongs to.

Default value: chinaPR

Maximum length: 255

phone

String

Mobile number.

NOTE:
  • The value must be prefixed with a country code.

  • When phone is specified, country must also be specified.

  • To clear the mobile number settings, leave country and phone empty.

Minimum length: 0

Maximum length: 32

email

String

Email address.

Minimum length: 0

Maximum length: 255

corpName

String

Organization name.

Minimum length: 0

Maximum length: 64

deptName

String

Department.

Minimum length: 0

Maximum length: 64

position

String

Job title.

Minimum length: 0

Maximum length: 64

address

String

Personal address.

Minimum length: 0

Maximum length: 1024

remarks

String

Remarks.

Minimum length: 0

Maximum length: 1024

id

String

UUID of an external contact.

name

String

Name.

customNumber

String

User-defined number of the external contact.

NOTE:

This parameter is used only in VDC scenarios.

updateTime

Number

Time when the user information was last updated.

type

String

Type of the external contact.

  • PERSONAL: individual's external contact.

  • CORP: enterprise's external contact.

Example Request

GET https://{endpoint}/v1/usg/abs/external-contacts?offset=0&limit=5&searchScope=CORP

Example Response

Status code: 200

Succeeded

{
  "offset" : 0,
  "limit" : 5,
  "count" : 1,
  "data" : [ {
    "otherNumber" : "",
    "otherNumberCountry" : "",
    "country" : "chinaPR",
    "phone" : "+86135xxxx0611",
    "email" : "lishi@example.com",
    "corpName" : null,
    "deptName" : null,
    "position" : null,
    "address" : null,
    "remarks" : null,
    "id" : "af4aaae4b29d45649e3c61f48ee2f64b",
    "name" : "Lucy",
    "customNumber" : null,
    "type" : "CORP",
    "updateTime" : 1665994358499
  } ]
}

Status Codes

Status Code

Description

200

Succeeded

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.