Match a Phone Number to a Contact

Match an incoming call number against the current user's contacts directory to identify the caller.

Request URL

POST {base_url}/uc-ccontact/api/v1/contacts/match-phone

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
phone Yes String The incoming call number to match.
contactId No String The ID of the contact to match against.
Note:
  • You can obtain the ID using the Query Contacts Directory interface.
  • If this parameter is not provided or set to 0, the system matches the phone number against all contacts in the following order of priority: internal users > personal contacts > company contacts.

contactType No String

The type of contact to match against.

Valid value:

  • CONTACT_TYPE_USER: Internal users.
  • CONTACT_TYPE_PERSONAL: Personal contacts.
  • CONTACT_TYPE_COMPANY: Company contacts.

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<Match_Result> The result of the match.
Match_Result
Parameter Type Description
matched Boolean Whether a contact matched the phone number.
isIntercom Boolean Whether the phone number is an internal number.
contact Object<Matched_Contact> The matched contact.
Matched_Contact
Parameter Type Description
contactId String The ID of the matched contact.
contactType Integer

The type of the matched contact.

  • 1: Internal user.
  • 2: Personal contact.
  • 3: Company contact.
firstName String The contact's first name.
lastName String The contact's last name.
company String The name of the company to which the contact belongs.
matchedPhone String The contact's phone number that matched the incoming call number.
avatarUrl String The URL of the contact avatar.
Note: This parameter returns with a value only when the contact type is CONTACT_TYPE_USER.
contactName String The display name of the contact.
remark String Additional notes about the contact.

Example

Request example

POST /uc-ccontact/api/v1/contacts/match-phone 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
{
  "phone": "1000"
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "6068338ae662a1e469d445b048f49fa3",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "matched": true,
    "isIntercom": true,
    "contact": {
      "contactId": "355536619424391168",
      "contactType": 1,
      "firstName": "3",
      "lastName": "1",
      "company": "",
      "matchedPhone": "1000",
      "avatarUrl": "",
      "contactName": "Leo"
    }
  }
}