The criteria
object specifies what contact
information to add or edit and for which database. The information can be
either a contact or a contact group. For a contact, the actual contact details
are contained in one or more keys,
with each key representing a specific piece of information. If no database
is specified, the information is added to the default database. If the default
database does not exist, it is created.
Use the Add
method
as follows:
To add a new contact or contact group, do not set its id
property.
To edit an existing contact or contact group, retrieve it
using GetList
,
edit the information, and then send it to Add
with the id
property
unchanged. This overwrites the old entry.
The criteria
object has two main properties: Type
and Data
.
These are described in the following table. Properties enclosed in brackets
are optional.
Note: All string values in the object are Unicode.
Property |
Description |
Type |
Value |
---|---|---|---|
|
Specifies the type of contact information to add or edit. |
string |
Possible values:
|
|
Specifies the contact information to add or edit. If |
object |
Object with the properties specified below |
|
Specifies the contacts database where the information is added or edited. If this property is not specified, the default database is used. |
string |
|
|
Specifies the unique identifier of the contact or contact group to add or edit. Note:
|
string |
|
|
Each key represents one piece of information about the contact, such as first name, last name, home phone number, or email address. At least one key must be specified for the contact. For example:
For a list of supported keys, see section Supported contact keys. Note: This property is valid only if |
object |
Object with the properties specified below |
|
Specifies a label that describes the key value. |
string |
|
|
Specifies the value for the key. If this is an empty string, the property is not included. |
string |
|
|
This is an object that specifies an additional value for the key. This
object contains the same properties as a key: There is no limit to how many nested values a key can contain. For example, an
The first email address is contained in |
object |
Object with the same properties as |
|
Specifies the name of the contact group. If the database does not support group labels, this property is ignored. SIM databases, for example, do not support group labels. Note: This property is valid only if |
string |