Searches the user's address book for entries matching given parameters.
The search is case insensitive.
Name | Description |
---|---|
options | An object containing search parameters. Please see the table below for more information. |
callbacks | An object containing two callback methods listed below. |
The table below lists the supported parameters.
Parameter | Description | Use |
---|---|---|
filterValue | A string value that will be matched against selected fields. Required for the filter to work. | Required |
filterOp | A filter operation. The Contacts API supports the following two operations: "is" and "contains". The default value is "contains". | Optional |
filterBy | An array of field names to include in filter. Required for the filter to work. The filter supports properties only, therefore no complex field definitions are allowed. To look for parameter attributes, use the "contains" filter operation. The following field names can be passed in the filterBy
parameter: |
Required |
filterLimit | A maximum number of search results. | Optional |
sortBy | The name of the field, by which search results will be sorted. Required for the sorting function to work. Only fields of the type "string" are allowed. | Required |
sortOrder | The Contacts API supports the following two sorting orders: "ascending" and "descending". The default value is "ascending". | Optional |
For example:
var options = { filterValue : "Developer", filterOp : "is", filterBy : ["jobTitle"], sortBy : "givenName", sortOrder : "ascending", filterLimit : 100 };
The remove
listener's callbacks
object can
be structured as follows:
{ onSuccess: function (contact) { ... }, onFailure: function (error) { ... } }
Name | Description | Return type |
---|---|---|
onSuccess | A callback function that accepts an array of contact entries that match the query. The entries of the returned contacts array are consistent with section 11 of the 2013 definition of the W3C Contacts Manager API specification specification. | undefined |
onFailure | Passed to notify that the process could not be completed. It passes an object that contains a description of an error, as listed in the Constants table of the Contacts article.
{ code, description }
|
undefined |