Query Contacts Directory

Retrieve the current user's contacts directory, including contact names and phone numbers.

Request URL

POST {base_url}/uc-ccontact/api/v1/personal-contacts/list-basic

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code Yes String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
pageNumber Yes Integer The page number to retrieve.
pageSize Yes Integer The number of records to retrieve per page.
contactTypes Yes Array<String>

The types of contacts to query.

Valid value:

  • CONTACT_TYPE_USER: Internal users.
  • CONTACT_TYPE_PERSONAL: Personal contacts.
  • CONTACT_TYPE_COMPANY: Company contacts.
query No String The keyword used to search for contacts.
isFavorited No Boolean

Whether to filter contacts by favorite status.

Valid value:

  • true: Return only the contacts added to favorites.
  • false: Return only the contacts not added to favorites.
Note: If this parameter is not provided, contacts are returned regardless of their favorite status.
sorts No Array<Sort_Condition> The sort conditions.
Sort_Condition
Parameter Required Type Description
property No String

The name of the field to sort by.

Valid value:

  • contact_name
  • extension
direction No String The sort order.

Valid value:

  • asc: Sort in ascending order.
  • desc: Sort in descending order.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Contact_Info> The basic information of the contacts.
Contact_Info
Parameter Type Description
pageSize Integer The number of records per page.
pageNumber Integer The current page number.
count String The total number of matching records.
results Array<Contact_Info> The list of matching contacts.
Contact_Info
Parameter Type Description
id String The unique identifier of the contact.
firstName String The contact's first name.
lastName String The contact's last name.
contactName String The display name of the contact.
company String The name of the company to which the contact belongs.
mobilePhone String The contact's primary mobile phone number.
businessPhone String The contact's primary business phone number.
homePhone String The contact's primary home phone number.
businessFax String The contact's primary business fax number.
homeFax String The contact's primary home fax number.
mobile2Phone String The contact's secondary mobile phone number.
business2Phone String The contact's secondary business phone number.
home2Phone String The contact's secondary home phone number.
otherPhone String The contact's additional phone number.
contactType String

The type of the contact.

  • CONTACT_TYPE_USER: Internal users.
  • CONTACT_TYPE_PERSONAL: Personal contacts.
  • CONTACT_TYPE_COMPANY: Company contacts.
isFavorited Boolean Whether the current user has added the contact to favorites.
presenceStatus String

The presence status of the contact (internal user).

  • AVAILABLE
  • AWAY
  • DND
  • LUNCH
  • BUSINESS_TRIP
  • OFF_WORK
online Boolean Whether the contact is online.
Note: This parameter returns with a value only when the contact type is CONTACT_TYPE_USER.
avatarUrl String The URL of the contact avatar.
Note: This parameter returns with a value only when the contact type is CONTACT_TYPE_USER.

Example

Request example

POST /uc-ccontact/api/v1/personal-contacts/list-basic HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkaXN0cmlidXRvcmV4YW1wbGVAb3V0bG9vay5jb20iLCJncmFudF90eXBlIjoib3BlbmFwaSIsImNsaWVudF9leHQiOnsiZGVzY3JpcHRpb24iOiLnrKzkuInmlrnlkIjkvZzkvJnkvLTlupTnlKgiLCJwYXJ0bmVyIjoi56S65L6L5ZCI5L2c5LyZ5Ly0In0sImNsaWVudF90eXBlIjoib3BlbmFwaSIsImV4cCI6MTc5MTY0MjQyMiwiaWF0IjoxNzkxNjIwODIyLCJqdGkiOiIyOGE3MmE2YS00N2RkLTQ1MTQtOGI0MC1kNTkzNGI2N2I4NmYiLCJjbGllbnRfaWQiOiJub3ZvLW9wZW4tcGxhdGZvcm0iLCJ1c2VyX2V4dCI6eyJyb2xlSWRzIjpbM10sInN0eXBlIjoiQURNSU4iLCJ0ZW5hbnRDb2RlIjpudWxsLCJ0eXBlIjoiUF9BQ0NPVU5UIiwidXNlcklkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJlbWFpbCI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInVzZXJuYW1lIjoiZGlzdHJpYnV0b3JleGFtcGxlQG91dGxvb2suY29tIiwidWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5Nn19.W0_22hu-nAYYmB_5evw8lmqlKsYChzcVHH7ZDz4GC0eA2AH6mGu--3v4tnYilWRJGIMQtHVlCe0eGRaBjuwYNEETX7sJOjX8-86qm34eJmgWfjbNGu9wDWA1C-RyFc39Re0AFMXl7Uw5RjhhbdEWLj6QKCKxgUfSZHD-4icUTByZHQ7HhRxwmbGFhV97S6W8fyVGFTuEnf5pIPNfn-nZiHu-z-238gPyKeueDOg_7zKxyGuibzrBthtmrjmYaZzZ2viu-kllZW51UEXAofSOGfbtYmwLEZ4MRMR3-TOPK1ZcBvghKiqGF3zS0sH99THVdhro-LqG7rY-jxW6LhS6Mw
Content-Type: application/json
x-tenant-code: jint
{
  "pageNumber": 1,
  "pageSize": 5,
  "contactTypes": [
    "CONTACT_TYPE_PERSONAL"
  ]
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "3c6a11ef96f019dc7cb0e16ad24408cd",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "results": [
      {
        "id": "346517262126862336",
        "firstName": "judy",
        "lastName": "",
        "contactName": "judy",
        "mobilePhone": "+8615880123456",
        "businessPhone": "",
        "homePhone": "",
        "businessFax": "",
        "homeFax": "",
        "mobile2Phone": "",
        "business2Phone": "",
        "home2Phone": "",
        "otherPhone": "",
        "contactType": "CONTACT_TYPE_PERSONAL",
        "company": "",
        "isFavorited": false,
        "presenceStatus": "AVAILABLE",
        "online": false,
        "avatarUrl": ""
      }
    ],
    "count": "1",
    "pageNumber": 1,
    "pageSize": 5
  }
}