# searchContact

Version: 4.2.0

Description: search for contacts on the server.

Search results are cached. The cache record lifetime is 5 minutes. There is also a limitation on search frequency. Only one search request is available every 20 seconds. If a request is made with a new search string during this timeout period, a corresponding error will be returned. If the search string that has already been requested is used, the cached result will be returned.

Request example:

{
    "method" : "searchContact",
    "searchingString" : "us",
    "searchingMask" : 7,
    "searchingTimeoutMsec" : 2000
}

Response example:

{
    "method": "searchContact",
    "requestId": "",
    "searchingResult": 0,
    "foundContacts": [{
        "peerId": "user1@some.server",
        "displayName": "U1"
    }, {
        "peerId": "user2@some.server",
        "displayName": "U2"
    }, {
        "peerId": "user3@some.server",
        "displayName": "U3"
    }],
    "result": true
}

Parameter description:

  • searchingResult - the string to search by

  • searchingTimeoutMsec - timeout for search and response output, in milliseconds. Available range of values - 1..20000.

  • searchingMask - a mask indicating search locations. Available locations:

    • 1 - search by unique user identifier

    • 2 - search by displayed username

    • 4 - search by user e-mail

  • searchingResult - search result. Possible values:

    • 0 - Request was successfully executed, timeouts were not reached, at least one contact was found.

    • 1 - request was successfully executed, timeouts were not reached, and no contacts were found.

    • 2 - the request was successfully executed, at least one contact was found, but the search was interrupted due to a timeout.

    • 3 - Request was successfully executed, no contacts were found, search timed out.

    • 4 - request was not completed due to incorrect parameters passed.

    • 5 - the request did not succeed because the timeout for a new search on the server was not passed.

  • requestId - unique identifier of the request

  • foundContacts - list of found contacts

  • peerId - unique identifier of the found contact.

  • displayName - displayed name of the found contact

See also: