# com.innovaphone.replicator

The com.innovaphone.replicator api enables apps to replicate entries into the database of the contacts app.

## Messages

ReplicationStart
ReplicationUpdate
ReplicationStop
ReplicationAbort

### ReplicationStart

Initiates a session

#### Parameters

string url | A string designator for this replicator's set of contact entries.
boolean hasExtAnchor | Indicate whether entries contain a unique, static external anchor. Alike a guid, uuid or database id (must be 'true' currently).

                {"mt":"ReplicatorAPI","src":"src-01",
                    "apimsg":{
                        "mt":"ReplicationStart",
                        "url":"test-url",
                        "hasExtAnchor":true
                    }
                }

### ReplicationStartResult

The result message for the ReplicationStart request.

#### Parameters

string error | An error string if an error happened (optional).

                {"mt":"ReplicationApi","src":"src-01","apimsg":{"mt":"ReplicationStartResult"}}

### ReplicationUpdate

Transmits an entry towards the contacts database

#### Parameters

array attrs | An array of objects, each carrying a tuple of attribute, value
string a | The name of an attribute
string v | The value of an attribute

    			{"mt":"ReplicatorAPI","src":"src-02", "apimsg":{"mt":"ReplicationUpdate",
    				"attrs":
    				[
    					{ "a": "sn", "v": "Replicator" },
    					{ "a": "givenName", "v": "Ronald" },
    					{ "a": "company", "v": "Smith Corp" },
    					{ "a": "street", "v": "Arlington Blvd 1" },
    					{ "a": "city", "v": "Munich" },
    					{ "a": "postalCode", "v": "89000" },
    					{ "a": "telephoneNumber", "v": "+49891234567" },
    					{ "a": "mobile", "v": "+491561234567" },
    					{ "a": "homePhone", "v": "+493361234567" },
    					{ "a": "description", "v": "Info für Ron" },
    					{ "a": "sip", "v": "ron.rep@smithcorp.com" },
    					{ "a": "extAnchor", "v": "2" }
    				]
    			}}

### ReplicationUpdateResult

The result message for the ReplicationUpdate request.

#### Parameters

string error | An error string if an error happened (optional).

                {"mt":"ReplicationApi","src":"src-02","apimsg":{"mt":"ReplicationUpdateResult"}}

### ReplicationStop

Indicates the final entry has been sent. Entries not being presented to the database will be removed.

#### Parameters

                {"mt":"ReplicatorAPI","src":"src-03", "apimsg":{"mt":"ReplicationStop"}}

### ReplicationStopResult

The result message for the ReplicationStop request.

#### Parameters

string error | An error string if an error happened (optional).

                {"mt":"ReplicationApi","src":"src-03","apimsg":{"mt":"ReplicationStopResult"}}

### ReplicationAbort

Indicates an abnormal termination due to some external error. No further write operations occur to the database.

#### Parameters

                {"mt":"ReplicatorAPI","src":"src-04", "apimsg":{"mt":"ReplicationAbort"}}

### ReplicationAbortResult

The result message for the ReplicationAbort request.

#### Parameters

string error | An error string if an error happened (optional).

                {"mt":"ReplicationApi","src":"src-04","apimsg":{"mt":"ReplicationAbortResult"}}