ObexCode Logo ObexCode Logo

Phone Synchronization setup

Before the phone is able to synchronize with the backup service, we need to configure it. This is done using over-the-air configuration via SMS as described in this document.

REST Endpoints

The following REST endpoints can be used for sending setup.

API Endpoint Supported Operations
Phone Datastore Binding http://api.obexcode.com/v2/syncengine/phone_datastore_bindings/setup/ POST
Syncml Client http://api.obexcode.com/v2/syncml/client/setup/ POST

Authentication

APIs for sending phone setup are protected and need authentication. See OAuth documentation for details.

Phone datastore binding

REST Endpoints

The following REST endpoint is used to send setup for a phone datastore binding

http://api.obexcode.com/v2/syncengine/phone_datastore_bindings/setup/

For the convenience setup for phones connected to datastore, setup to the phone can be sent by posting a request to the "setup" endpoint belonging to the PhoneDatastoreBinding entry received when registering the binding.

Example of a received entry, from the binding example.

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:oc="http://schemas.obexcode.com/syncserver/2009">
  <id>http://api.obexcode.com/v2/syncengine/phone_datastore_bindings/12/</id>
  <oc:model_uuid>02978288-537f-102b-beff-000ea60275d1</oc:model_uuid>
  <oc:phone_number>+4799988877</oc:phone_number>
  <oc:foreign_user_id>my_user:1456</oc:foreign_user_id>
  <oc:timezone>Europe/Oslo</oc:timezone>
</entry>

To send setup to the phone registered in the above example, use the returned and append "send_phone_setup".

POST /v2/syncengine/phone_datastore_bindings/12/setup/ HTTP/1.1
Host: api.obexcode.com
Content-type: application/atom+xml

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:oc="http://schemas.obexcode.com/syncserver/2009">
  <oc:pincode>1234</oc:pincode>
</entry>

The response will be the entry with generated fields inserted.

HTTP/1.1 201 Created
Content-Type: application/atom+xml
Content-Length: ??

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:oc="http://schemas.obexcode.com/syncserver/2009">
  <id>http://api.obexcode.com/v2/syncengine/phone_datastore_bindings/12/setup/143/</id>
  <oc:pincode>1234</oc:pincode>
  <oc:setup sent="2008-08-15T16:13:03Z">Mobile Backup</oc:setup>
</entry>

Pincode may be ommitted in the requesting entry as well, it will then be supplied by the sync server. Note that the returned pincode must then be presented for the user.

The user must accept the configuration by entering the pin code and storing the configuration to the phone. Then the phone is ready for synchronization.

Note: The setup SMS provides specifications for the dataclasses supported by the backup service. Some phones have support for additional dataclasses not yet supported by our application, such as e-mail, sms or bookmarks. If the user attempts to add these manually an error will occur when syncronizing.

Here is a complete code example in Python.

Register SyncML client

See the SyncML Client API.