Search Contacts from Search Bar
Search for internal users, personal contacts, and company contacts using the search bar.
Request URL
POST {base_url}/uc-ccontact/api/v1/web/top-search
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 type Yes String The type of the section to search.
Valid value:
SECTION_TYPE_USER: Internal users.SECTION_TYPE_CONTACT: Contacts.SECTION_TYPE_CALL_LOG: Call log.
query No String The keyword used to search for records. page No Integer The page number to retrieve. pageSize No Integer The number of records to retrieve per page. startTime No String The start time of the time range, in Unix timestamp format (milliseconds). Note: This parameter applies to thecall_logsection only.endTime No String The end time of the time range, in Unix timestamp format (milliseconds). Note: This parameter applies to thecall_logsection only.
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.
|
| 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<Search_Result> | The search result of the section. |
- Search_Result
-
Parameter Type Description type String The type of the section that is searched. SECTION_TYPE_USER: Internal users.SECTION_TYPE_CONTACT: Contacts.SECTION_TYPE_CALL_LOG: Call log.
contactItems Array<Contact_Item> The search result of the user and contact sections. callLogItems Array<Call_Log_Item> The search result of the call log section. total String The total number of records in the section. hasMore Boolean Whether more records exist. page Integer The current page number. pageSize Integer The number of records per page.
- Contact_Item
-
Parameter Type Description contactId String The ID of the contact. contactType String The type of the contact.
CONTACT_TYPE_USER: Internal user.CONTACT_TYPE_PERSONAL: Personal contact.CONTACT_TYPE_COMPANY: Company contact.
name String The display name of the contact. phones Array<Phone_Item> The phone numbers of the contact. extension String The extension number of the contact. Note: This parameter is returned with a value only when the contact type isCONTACT_TYPE_USER.avatarUrl String The URL of the contact avatar. Note: This parameter is returned with a value only when the contact type isCONTACT_TYPE_USER.isFavorited Boolean Whether the current user has added the contact to favorites. presenceStatus String The presence status of the contact.
AVAILABLEAWAYDNDLUNCHBUSINESS_TRIPOFF_WORK
company String The name of the company. Note: This parameter is returned with a value only when the section type isSECTION_TYPE_CONTACT.position String The position of the contact. Note: This parameter is returned with a value only when the section type isSECTION_TYPE_CONTACT.online Boolean Whether the contact is online. Note: This parameter is returned with a value only when the contact type isCONTACT_TYPE_USER.
- Phone_Item
-
Parameter Type Description type String The type of the phone number.
Valid value:
MOBILE_PHONEBUSINESS_PHONEHOME_PHONEBUSINESS_FAXHOME_FAXMOBILE2_PHONEBUSINESS2_PHONEHOME2_PHONEOTHER_PHONE
number String The phone number.
- Call_Log_Item
-
Parameter Type Description id String The ID of the call log. uid String The unique identifier of the call. timestamp String The time when the call was made or received, in Unix timestamp format (microseconds). callType String The type of the call. inboundoutboundinternal
callStatus String The status of the call. answeredno_answerbusyfailedabandoned
category String The category of the call. incomingmissedoutgoing
number String The caller number or the callee number of the call. name String The name of the contact. numberType String The type of the number. extensionextension_mobileexternalpersonal_contactcompany_contact
companyName String The name of the company. avatar String The URL of the contact avatar. presence String The presence status of the contact. availableawaydo_not_disturblunchbusiness_tripoff_work
totalDuration Integer The total duration of the call, in seconds. hasRecording Boolean Whether the call has a recording. recordingDuration Integer The duration of the recording, in seconds. sourceFeature String The feature that the call originates from. queuering_group
sourceNumber String The number of the source call feature. sourceName String The name of the source call feature. processStatus Integer The processing status of the call. 1: Not deal2: Dealing3: Dealt
processBy String The ID of the agent who processed the call. processByName String The name of the agent who processed the call. processAt String The time when the call was processed, in Unix timestamp format (microseconds).
Example
Request example
POST /uc-ccontact/api/v1/web/top-search HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkaXN0cmlidXRvcmV4YW1wbGVAb3V0bG9vay5jb20iLCJncmFudF90eXBlIjoib3BlbmFwaSIsImNsaWVudF9leHQiOnsiZGVzY3JpcHRpb24iOiLnrKzkuInmlrnlkIjkvZzkvJnkvLTlupTnlKgiLCJwYXJ0bmVyIjoi56S65L6L5ZCI5L2c5LyZ5Ly0In0sImNsaWVudF90eXBlIjoib3BlbmFwaSIsImV4cCI6MTc5MTc5ODcyMSwiaWF0IjoxNzkxNzc3MTIxLCJqdGkiOiI3YjRmNDQ3MC1jZmI0LTQ3NTAtYTg4Zi01ZjIxNjY5ZDI3NzUiLCJjbGllbnRfaWQiOiJub3ZvLW9wZW4tcGxhdGZvcm0iLCJ1c2VyX2V4dCI6eyJyb2xlSWRzIjpbM10sInN0eXBlIjoiQURNSU4iLCJ0ZW5hbnRDb2RlIjpudWxsLCJ0eXBlIjoiUF9BQ0NPVU5UIiwidXNlcklkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJlbWFpbCI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInVzZXJuYW1lIjoiZGlzdHJpYnV0b3JleGFtcGxlQG91dGxvb2suY29tIiwidWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5Nn19.Vb9Xw8-vvI689EzR9bl9jrH3BWBDrYPl9c10AzyTv-LjTxxbNdYiz-9k_FBhe3HSqSeLdDXb0py1fzUhJ-e2wIn9Sq2ZeOz4IQAJQwjmyG9-Kk0jy43iyLkcBO7LQxfVQksnKs7hB0cG9FIhoil-FiQL_mUwNHCVN-BnfoN4Dyiyp7BE8nHiehlng4SUQ5zxgQf_JlqALzcP6bNlvp4k1AfjoY2KKQ7H7g9nGSZZZ2fv_j65-j_XJKpLR4ujC7iDH6MezGg8RgOKwHE2HSgtxfiIrHF8wQVhrlKFgCGu1dvszp5mvXPXLy3WnMjuCCidLYI2NvRhfVHd1VzB13XteA
Content-Type: application/json
x-tenant-code: jint
{
"type": "SECTION_TYPE_USER"
}
Response example
HTTP/1.1 200 OK { "requestId": "ab7b53912b50c4ab458f495a24008eb8", "code": "200", "message": "SUCCESS", "detailMessage": "", "result": { "type": "SECTION_TYPE_USER", "contactItems": [ { "contactId": "355536619424391168", "contactType": "CONTACT_TYPE_USER", "name": "Leo", "phones": [], "extension": "1000", "avatarUrl": "", "isFavorited": false, "presenceStatus": "AVAILABLE", "company": "", "position": "", "online": false }, { "contactId": "355545562435493888", "contactType": "CONTACT_TYPE_USER", "name": "Smith", "phones": [], "extension": "1001", "avatarUrl": "", "isFavorited": false, "presenceStatus": "AVAILABLE", "company": "", "position": "", "online": true } ], "callLogItems": [], "total": "2", "hasMore": false, "page": 1, "pageSize": 5 } }