Home | Index

Address Book XML/JSON API Developer Guide

Synchronize Response

A synchronize Request returns a Response with either an error or a success block. The general format of a Response is as follows:

+----------------------------------------+
|SYNC-RESPONSE                           |
| - lmt: ... current LMT ...             |
| - rev: ... current revision  ...       |
| - categories:                          |    _
|    +--------------------------------+  |     \
|    |CATEGORY                        |  |      | possibly an empty
|    | - catid: ...cat id...          |  |      | table of categories
|    | - data: ...cat name...         |  |      | /may/ be omitted
|    +--------------------------------+  |      | if "events" is empty
|    .... more categories ...            |    _/
| - results (0..*):                      |     \
| ... sequence of entities of type:      |      | omitted in
|       * ERROR                          |      | the read case
|       * SUCCESS                        |    _/
| - events (0..*):                       |
| ... sequence of entities of type:      |
|       * ADDRESS-BOOK-RESET             |
|       * ADD-CONTACT                    |
|       * UPDATE-CONTACT                 |
|       * REMOVE-CONTACT                 |
+----------------------------------------+

     +--------------------------------+
     |ADDRESS-BOOK-RESET              |
     | - lmt: ... reset time ...      |
     +--------------------------------+

     +--------------------------------+
     |ADD-CONTACT                     |
     | - cid: ... contact id...       |
     | - lmt: ... contact mod time ...|
     | - fields:                      |
     |    +------------------------+  |
     |    |(field-type)            |  |
     |    | ... field contents ... |  |
     |    | - categories:          |  |
     |    |    +----------------+  |  |
     |    |    |CATEGORY        |  |  |
     |    |    | - catid: ...   |  |  |
     |    |    +----------------+  |  |
     |    +------------------------+  |
     |    .... more field events ...  |
     | - categories:                  |
     |    +------------------------+  |
     |    |CATEGORY                |  |
     |    | - catid: ...cat id...  |  |
     |    +------------------------+  |
     |    .... more categories ....   |
     +--------------------------------+


     +--------------------------------+
     |UPDATE-CONTACT                  |
     |  ....see add-contact above.... |
     +--------------------------------+

     +--------------------------------+
     |REMOVE-CONTACT                  |
     | - cid: ... contact ID ...      |
     | - lmt: ... contact del time ...|
     +--------------------------------+
[Note] Note

The table of categories at the beginning of the response may be omitted by Address Book servers for performance reasons if there are no events to report. When present in the response, the table of categories is the complete list of categories that currently exist in the Address Book.

An add-contact operation causes cid and add-action to be set in the corresponding success response entity. An add-category operation causes catid to be set in the corresponding success response entity. Other operations produce an empty success entity on success at the corresponding position.

Error entities are standard error responses relating to the particular operation. See the Error Reporting section for more information.

+--------------------------------+
|ERROR                           |
| - code                         |
| - user-message                 |
| - debug-message                |
| - retry-after (optional)       |
+--------------------------------+

Success responses are small blocks with an optional add action indicator (add or merge), a contact ID, or a category ID:

+--------------------------------+
|SUCCESS                         |
| - add-action (optional)        |
| - cid (optional)               |
| - catid (optional)             |
+--------------------------------+