Personal Contacts Synchronization
The process for synchronizing personal contacts is as follows:
Client gets a sync token from the server by sending a POST request to /api/user/contacts/sync_tokens.
Server reports token 001.
Some time passes.
Client performs a sync operation by sending a POST request to /api/user/contacts/sync_tokens/{token}, supplying token 001.
Server returns contacts that have been created, updated, or deleted and returns token 002.
Getting the First Sync Token
Initially, request a sync token for contacts:
curl -X POST 'https://HOSTNAME:PORT/api/user/contacts/sync_tokens'
This would return something like the following:
{
"token": "001"
}
Receiving Changes
After a sync token has been obtained, the client can request all changes since the token was issued. This is done with a request that may look like this:
curl -X POST 'https://HOSTNAME:PORT/api/user/contacts/sync_tokens/001'
This would return something like the following:
{
"token": "002",
"items": [
{
"id": "CREATED-ITEM-ID",
"name": "...",
"email": "...",
"company": "...",
"title": "...",
"business": "...",
"business2": "...",
"mobile_phone": "...",
"mobile_phone2": "...",
"home_phone": "...",
"home_phone2": "...",
"other": "...",
"business_fax": "...",
"home_fax": "...",
"address": "...",
"notes": "...",
"favorite": "...",
"change_type": "CREATED"
},
{
"id": "UPDATED-ITEM-ID",
"name": "...",
"email": "...",
"company": "...",
"title": "...",
"business": "...",
"business2": "...",
"mobile_phone": "...",
"mobile_phone2": "...",
"home_phone": "...",
"home_phone2": "...",
"other": "...",
"business_fax": "...",
"home_fax": "...",
"address": "...",
"notes": "...",
"favorite": "...",
"change_type": "UPDATED"
},
{
"id": "DELETED-ITEM-ID",
"name": "...",
"email": "...",
"company": "...",
"title": "...",
"business": "...",
"business2": "...",
"mobile_phone": "...",
"mobile_phone2": "...",
"home_phone": "...",
"home_phone2": "...",
"other": "...",
"business_fax": "...",
"home_fax": "...",
"address": "...",
"notes": "...",
"favorite": "...",
"change_type": "DELETED"
}
]
}