Work in progress #3: More sync process
[tolino-api-docs.git] / api / pageplace.bosh-bosh-rest-sync-data.rst
1 =======================================================
2 ``PATCH https://bosh.pageplace.de/bosh/rest/sync-data``
3 =======================================================
4 Send changes to the server and get changes since last sync back.
5 This is the main API method for synchronization.
6
7 Part of the `Sync process`_.
8
9 Request
10 =======
11 Header
12   ``t_auth_token``
13     OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
14
15     Example: ``eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
16   ``Content-Type``
17     ``application/json; charset=UTF-8``
18   ``Accept``
19     ``application/json; charset=UTF-8``
20   ``reseller_id``
21     Example: ``3``
22   ``hardware_id``
23     Example: ``665fc389ef4e47258c5db9fa7821bd19``
24   ``client_type``
25     Example: ``TOLINO_VISION_3``
26 GET parameters
27   ``paths``
28     Example: ``publications``
29
30     FIXME: What else?
31 Request body parameters
32   ``revision``
33     ``revision`` of last sync response.
34
35     ``null`` when it is the first sync ever for this device.
36   ``patches``
37     Array of changes.
38
39     No data to sync: Empty array ``[]``.
40
41     FIXME: document structure
42
43
44 First sync request
45 ------------------
46 When nothing needs to be synchronized to the server, and nothing
47 ever has been synchronized:
48
49 .. include:: pageplace.bosh-bosh-rest-sync-data.request-first.json
50    :code:
51
52
53 Response
54 ========
55 HTTP status code: ``200 OK``
56
57 FIXME: document different types and how progress is saved
58
59
60 New bookmarks and comments
61 --------------------------
62 Example:
63
64 .. include:: pageplace.bosh-bosh-rest-sync-data.response-bookmarks-comments.json
65    :code: