Work in progress #4: Finish sync process
authorChristian Weiske <[email protected]>
Mon, 22 Feb 2021 19:43:26 +0000 (20:43 +0100)
committerChristian Weiske <[email protected]>
Mon, 22 Feb 2021 19:43:26 +0000 (20:43 +0100)
README.rst
api/pageplace.bosh-bosh-rest-dictionary-list.response.json [new file with mode: 0644]
api/pageplace.bosh-bosh-rest-dictionary-list.rst [new file with mode: 0644]
api/pageplace.family-v1-family.response-members.json [new file with mode: 0644]
api/pageplace.family-v1-family.rst [new file with mode: 0644]
api/pageplace.family-v1-myself.response-member.json [new file with mode: 0644]
api/pageplace.family-v1-myself.response-nomember.json [new file with mode: 0644]
api/pageplace.family-v1-myself.rst [new file with mode: 0644]
api/pageplace.family-v1-shares.response-3books.json [new file with mode: 0644]
api/pageplace.family-v1-shares.rst [new file with mode: 0644]
api/usecase-sync.rst

index 7919fe605dece638180f8e7cf916fc8087f45d15..f7c99b83ede9f29cde41aa22ef6ac665e971301f 100644 (file)
@@ -24,6 +24,7 @@ Use cases
 
 API calls
 *********
+.. include:: api/pageplace.bosh-bosh-rest-dictionary-list.rst
 .. include:: api/pageplace.bosh-bosh-rest-handshake-resellers.rst
 .. include:: api/pageplace.bosh-bosh-rest-inventory-count.rst
 .. include:: api/pageplace.bosh-bosh-rest-ping.rst
@@ -33,6 +34,9 @@ API calls
 .. include:: api/pageplace.bosh-bosh-rest-userid-xxx.rst
 .. include:: api/pageplace.bosh-bosh-rest-v2-registerhw.rst
 .. include:: api/pageplace.bosh-bosh-rest-v2-resellerconfig.rst
+.. include:: api/pageplace.family-v1-family.rst
+.. include:: api/pageplace.family-v1-myself.rst
+.. include:: api/pageplace.family-v1-shares.rst
 .. include:: api/pageplace.inventory-v2-inventory.rst
 .. include:: api/thalia-auth-oauth2-authorize.rst
 .. include:: api/thalia-auth-oauth2-token-post.rst
diff --git a/api/pageplace.bosh-bosh-rest-dictionary-list.response.json b/api/pageplace.bosh-bosh-rest-dictionary-list.response.json
new file mode 100644 (file)
index 0000000..eae1bf1
--- /dev/null
@@ -0,0 +1,204 @@
+{
+  "dictionaryListResponse": {
+    "dictionaryEntries": [
+      {
+        "id": 15,
+        "filename": "EN-IT.quickdic",
+        "file_sha1": "bf31e5d240e8c044c11b0e338fe520648d701dec",
+        "download_url": "https://download.pageplace.de/dictionary/EN-IT.quickdic.zip",
+        "file_size": 107805685,
+        "language_from": "EN",
+        "language_to": "IT",
+        "last_modified": 1470058728000,
+        "created": 1416587670000
+      },
+      {
+        "id": 16,
+        "filename": "IT-ES.quickdic",
+        "file_sha1": "8d891665a0f3f894fe7f8565cedd301c7e92095f",
+        "download_url": "https://download.pageplace.de/dictionary/IT-ES.quickdic.zip",
+        "file_size": 706110,
+        "language_from": "IT",
+        "language_to": "ES",
+        "last_modified": 1416587671000,
+        "created": 1416587671000
+      },
+      {
+        "id": 17,
+        "filename": "IT-FR.quickdic",
+        "file_sha1": "fd0e84f7273ed8642f2ca1b55dc679607245b068",
+        "download_url": "https://download.pageplace.de/dictionary/IT-FR.quickdic.zip",
+        "file_size": 700760,
+        "language_from": "IT",
+        "language_to": "FR",
+        "last_modified": 1416587672000,
+        "created": 1416587672000
+      },
+      {
+        "id": 1410196761,
+        "filename": "FR.quickdic",
+        "file_sha1": "beee10118cfd6ee32542a3a5eee7a71a3007e798",
+        "download_url": "https://download.pageplace.de/dictionary/FR.quickdic.zip",
+        "file_size": 116064083,
+        "language_from": "FR",
+        "language_to": null,
+        "last_modified": 1391428950000,
+        "created": 1384855786000
+      },
+      {
+        "id": 1410196762,
+        "filename": "ES.quickdic",
+        "file_sha1": "7f994be6876686dd0a4432060266b0c4dbfb41db",
+        "download_url": "https://download.pageplace.de/dictionary/ES.quickdic.zip",
+        "file_size": 53858404,
+        "language_from": "ES",
+        "language_to": null,
+        "last_modified": 1384855788000,
+        "created": 1384855788000
+      },
+      {
+        "id": 8,
+        "filename": "DE.quickdic",
+        "file_sha1": "dedc33464bfd0a34ee401dba6e3c8856f3219634",
+        "download_url": "https://download.pageplace.de/dictionary/DE.quickdic.zip",
+        "file_size": 79032764,
+        "language_from": "DE",
+        "language_to": null,
+        "last_modified": 1384855908000,
+        "created": 1380285437000
+      },
+      {
+        "id": 9,
+        "filename": "NL.quickdic",
+        "file_sha1": "8e4fa722779bc5b54089bd85856890ea32d2ab71",
+        "download_url": "https://download.pageplace.de/staging/dictionary/NL.quickdic.zip",
+        "file_size": 24209379,
+        "language_from": "NL",
+        "language_to": null,
+        "last_modified": 1403259975000,
+        "created": 1403259975000
+      },
+      {
+        "id": 10,
+        "filename": "DE_NL.quickdic",
+        "file_sha1": "2ef65bddb61b6a0ae502e803e456e238671f03a1",
+        "download_url": "https://download.pageplace.de/staging/dictionary/DE_NL.quickdic.zip",
+        "file_size": 947379,
+        "language_from": "DE",
+        "language_to": "NL",
+        "last_modified": 1403260008000,
+        "created": 1403260008000
+      },
+      {
+        "id": 11,
+        "filename": "EN_NL.quickdic",
+        "file_sha1": "6084cddce46832aea01eb58542a4844a2ae4ee3e",
+        "download_url": "https://download.pageplace.de/staging/dictionary/EN_NL.quickdic.zip",
+        "file_size": 5687123,
+        "language_from": "NL",
+        "language_to": "EN",
+        "last_modified": 1403260051000,
+        "created": 1403260051000
+      },
+      {
+        "id": 12,
+        "filename": "FR_NL.quickdic",
+        "file_sha1": "88f5974614a98d328930149e1d009b41470c17fb",
+        "download_url": "https://download.pageplace.de/staging/dictionary/FR_NL.quickdic.zip",
+        "file_size": 3991711,
+        "language_from": "NL",
+        "language_to": "FR",
+        "last_modified": 1403260078000,
+        "created": 1403260078000
+      },
+      {
+        "id": 13,
+        "filename": "NO_NL.quickdic",
+        "file_sha1": "1e20eb807ff5fdf2169d905ce23fa2d74732ffca",
+        "download_url": "https://download.pageplace.de/staging/dictionary/NO_NL.quickdic.zip",
+        "file_size": 847956,
+        "language_from": "NL",
+        "language_to": "NO",
+        "last_modified": 1403260107000,
+        "created": 1403260107000
+      },
+      {
+        "id": 1610761154,
+        "filename": "EN-FR.quickdic",
+        "file_sha1": "5c419822146d2ad3f941fc2659c4346c53a46f06",
+        "download_url": "https://download.pageplace.de/staging/dictionary/EN-FR.quickdic.zip",
+        "file_size": 97389181,
+        "language_from": "EN",
+        "language_to": "FR",
+        "last_modified": 1463490158000,
+        "created": 1463490158000
+      },
+      {
+        "id": 2,
+        "filename": "DE-EN.quickdic",
+        "file_sha1": "eab9d5be9fc01a7cb9e689f865febf088bd9f56c",
+        "download_url": "https://download.pageplace.de/dictionary/DE-EN.quickdic.zip",
+        "file_size": 49376638,
+        "language_from": "DE",
+        "language_to": "EN",
+        "last_modified": 1381395549000,
+        "created": null
+      },
+      {
+        "id": 3,
+        "filename": "DE-ES.quickdic",
+        "file_sha1": "6b26b23ad8658bdffb7d68c54451f36734fde3e2",
+        "download_url": "https://download.pageplace.de/dictionary/DE-ES.quickdic.zip",
+        "file_size": 2742937,
+        "language_from": "DE",
+        "language_to": "ES",
+        "last_modified": 1381395549000,
+        "created": null
+      },
+      {
+        "id": 4,
+        "filename": "DE-FR.quickdic",
+        "file_sha1": "0f0bb4334b8c5ea21fa3b7063a36943914793746",
+        "download_url": "https://download.pageplace.de/dictionary/DE-FR.quickdic.zip",
+        "file_size": 12732080,
+        "language_from": "DE",
+        "language_to": "FR",
+        "last_modified": 1381395549000,
+        "created": null
+      },
+      {
+        "id": 5,
+        "filename": "DE-IT.quickdic",
+        "file_sha1": "236b5aae8488ce1b7709f84d7eab1a2d75152405",
+        "download_url": "https://download.pageplace.de/dictionary/DE-IT.quickdic.zip",
+        "file_size": 8348482,
+        "language_from": "DE",
+        "language_to": "IT",
+        "last_modified": 1381395549000,
+        "created": null
+      },
+      {
+        "id": 6,
+        "filename": "EN.quickdic",
+        "file_sha1": "9b541e02abcb9f2cfe06ae5762dc00f1919c8495",
+        "download_url": "https://download.pageplace.de/dictionary/EN.quickdic.zip",
+        "file_size": 113927204,
+        "language_from": "EN",
+        "language_to": null,
+        "last_modified": 1381395549000,
+        "created": null
+      },
+      {
+        "id": 7,
+        "filename": "IT.quickdic",
+        "file_sha1": "5970a7ca9bf905693c4138ad0fbbc3b1c0f8c92d",
+        "download_url": "https://download.pageplace.de/dictionary/IT.quickdic.zip",
+        "file_size": 11566432,
+        "language_from": "IT",
+        "language_to": null,
+        "last_modified": 1416392412000,
+        "created": null
+      }
+    ]
+  }
+}
diff --git a/api/pageplace.bosh-bosh-rest-dictionary-list.rst b/api/pageplace.bosh-bosh-rest-dictionary-list.rst
new file mode 100644 (file)
index 0000000..c791158
--- /dev/null
@@ -0,0 +1,46 @@
+===========================================================
+``GET https://bosh.pageplace.de/bosh/rest/dictionary/list``
+===========================================================
+
+Fetch the list of downloadable dictionaries.
+
+Part of the `sync process`_.
+
+
+Request
+=======
+Header
+  ``t_auth_token``
+    OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
+
+    Example: ``eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
+  ``Accept``
+    Example: ``application/json; charset=UTF-8``
+  ``m_id``
+    FIXME: Maybe reseller ID?
+
+    Example: ``3``
+  ``hardware_id``
+    Seems to be the same as the ``xxx`` value in the URL.
+
+    Example: ``665fc389ef4e47258c5db9fa7821bd19``
+  ``Content-Type``
+    ``application/json; charset=UTF-8``
+
+    This is a lie; there is no request body.
+  ``client_type``
+    Example: ``TOLINO_VISION_3``
+  ``client_version``
+    Example: ``14.1.0``
+
+No request body.
+
+
+Response
+========
+HTTP status code ``200 OK``.
+
+Example:
+
+.. include:: pageplace.bosh-bosh-rest-dictionary-list.response.json
+   :code:
diff --git a/api/pageplace.family-v1-family.response-members.json b/api/pageplace.family-v1-family.response-members.json
new file mode 100644 (file)
index 0000000..4cb1149
--- /dev/null
@@ -0,0 +1,13 @@
+{
+    "maxMembers": 6,
+    "members": [
+        {
+            "membershipId": 67674,
+            "nickname": "oldtest"
+        },
+        {
+            "membershipId": 67675,
+            "nickname": "dev"
+        }
+    ]
+}
diff --git a/api/pageplace.family-v1-family.rst b/api/pageplace.family-v1-family.rst
new file mode 100644 (file)
index 0000000..aacb47b
--- /dev/null
@@ -0,0 +1,61 @@
+=============================================
+``GET https://family.pageplace.de/v1/family``
+=============================================
+
+Get the list of family members.
+
+Part of the `sync process`_.
+
+This is only called when the user has family member data
+(`GET https://family.pageplace.de/v1/myself`_).
+
+
+Request
+=======
+Header
+  ``Authorization``
+    OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
+
+    Example: ``Bearer eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
+  ``Accept``
+    Example: ``application/json; charset=UTF-8``
+  ``Accept-Encoding``
+    ``gzip``
+  ``m_id``
+    FIXME: Maybe reseller ID?
+
+    Example: ``3``
+  ``Hardware-Id``
+    Example: ``665fc389ef4e47258c5db9fa7821bd19``
+  ``Content-Type``
+    ``application/json; charset=UTF-8``
+
+    This is a lie; there is no request body.
+  ``client_type``
+    Example: ``TOLINO_VISION_3``
+  ``client_version``
+    Example: ``14.1.0``
+  ``Reseller-Id``
+    Example: ``3``
+  ``Cookie``
+    Multiple times:
+
+    -  ``OAUTH-JSESSIONID=3EFAEC6B69D811252C75861880C338AB.15acdb90; Path=/; Secure; HttpOnly``
+    - ``JSESSIONID=C0D8A077F6D2E13251ECDCD60FE6D18A``
+  ``Cookie2``
+    Example: ``$Version=1``
+
+No request body.
+
+
+Response
+========
+HTTP status code ``200 OK``.
+
+
+Family members
+--------------
+Example:
+
+.. include:: pageplace.family-v1-family.response-members.json
+   :code:
diff --git a/api/pageplace.family-v1-myself.response-member.json b/api/pageplace.family-v1-myself.response-member.json
new file mode 100644 (file)
index 0000000..a24680a
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "membershipId": 67675,
+    "nickname": "dev"
+}
diff --git a/api/pageplace.family-v1-myself.response-nomember.json b/api/pageplace.family-v1-myself.response-nomember.json
new file mode 100644 (file)
index 0000000..770f571
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "membershipId": null,
+    "nickname": null
+}
diff --git a/api/pageplace.family-v1-myself.rst b/api/pageplace.family-v1-myself.rst
new file mode 100644 (file)
index 0000000..6bc5926
--- /dev/null
@@ -0,0 +1,66 @@
+=============================================
+``GET https://family.pageplace.de/v1/myself``
+=============================================
+
+Obtain the family member ID.
+
+Part of the `sync process`_.
+
+
+Request
+=======
+Header
+  ``Authorization``
+    OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
+
+    Example: ``Bearer eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
+  ``Accept``
+    Example: ``application/json; charset=UTF-8``
+  ``Accept-Encoding``
+    ``gzip``
+  ``m_id``
+    FIXME: Maybe reseller ID?
+
+    Example: ``3``
+  ``Hardware-Id``
+    Example: ``665fc389ef4e47258c5db9fa7821bd19``
+  ``Content-Type``
+    ``application/json; charset=UTF-8``
+
+    This is a lie; there is no request body.
+  ``client_type``
+    Example: ``TOLINO_VISION_3``
+  ``client_version``
+    Example: ``14.1.0``
+  ``Reseller-Id``
+    Example: ``3``
+  ``Cookie``
+    Multiple times:
+
+    -  ``OAUTH-JSESSIONID=3EFAEC6B69D811252C75861880C338AB.15acdb90; Path=/; Secure; HttpOnly``
+    - ``JSESSIONID=C0D8A077F6D2E13251ECDCD60FE6D18A``
+  ``Cookie2``
+    Example: ``$Version=1``
+
+No request body.
+
+
+Response
+========
+HTTP status code ``200 OK``.
+
+
+No family membership
+--------------------
+Example:
+
+.. include:: pageplace.family-v1-myself.response-nomember.json
+   :code:
+
+
+Member information
+-------------------
+Example:
+
+.. include:: pageplace.family-v1-myself.response-member.json
+   :code:
diff --git a/api/pageplace.family-v1-shares.response-3books.json b/api/pageplace.family-v1-shares.response-3books.json
new file mode 100644 (file)
index 0000000..44fd9c0
--- /dev/null
@@ -0,0 +1,30 @@
+[
+  {
+    "type": "SHARED",
+    "publicationId": "DT0400.9783739673417_A27522964",
+    "sharer": {
+      "membershipId": 67675,
+      "nickname": "dev"
+    },
+    "receivers": [
+      {
+        "membershipId": 67674,
+        "nickname": "oldtest"
+      }
+    ]
+  },
+  {
+    "type": "SHARED",
+    "publicationId": "DT0400.9783641243609_A40398678",
+    "sharer": {
+      "membershipId": 67675,
+      "nickname": "dev"
+    },
+    "receivers": [
+      {
+        "membershipId": 67674,
+        "nickname": "oldtest"
+      }
+    ]
+  }
+]
diff --git a/api/pageplace.family-v1-shares.rst b/api/pageplace.family-v1-shares.rst
new file mode 100644 (file)
index 0000000..fef5b2f
--- /dev/null
@@ -0,0 +1,63 @@
+=============================================
+``GET https://family.pageplace.de/v1/shares``
+=============================================
+
+Obtain the list of books shared in the family.
+
+FIXME: Only books that are shared from/to the current user?
+
+Part of the `sync process`_.
+
+This is only called when the user has family member data
+(`GET https://family.pageplace.de/v1/myself`_).
+
+
+Request
+=======
+Header
+  ``Authorization``
+    OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
+
+    Example: ``Bearer eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
+  ``Accept``
+    Example: ``application/json; charset=UTF-8``
+  ``Accept-Encoding``
+    ``gzip``
+  ``m_id``
+    FIXME: Maybe reseller ID?
+
+    Example: ``3``
+  ``Hardware-Id``
+    Example: ``665fc389ef4e47258c5db9fa7821bd19``
+  ``Content-Type``
+    ``application/json; charset=UTF-8``
+
+    This is a lie; there is no request body.
+  ``client_type``
+    Example: ``TOLINO_VISION_3``
+  ``client_version``
+    Example: ``14.1.0``
+  ``Reseller-Id``
+    Example: ``3``
+  ``Cookie``
+    Multiple times:
+
+    -  ``OAUTH-JSESSIONID=3EFAEC6B69D811252C75861880C338AB.15acdb90; Path=/; Secure; HttpOnly``
+    - ``JSESSIONID=C0D8A077F6D2E13251ECDCD60FE6D18A``
+  ``Cookie2``
+    Example: ``$Version=1``
+
+No request body.
+
+
+Response
+========
+HTTP status code ``200 OK``.
+
+
+Family members
+--------------
+Example:
+
+.. include:: pageplace.family-v1-shares.response-3books.json
+   :code:
index 15cc0c009b43c17acdc388f3ae4599e040372e77..fbc26ad453b370f5d8995f86c1b7abc15d930e88 100644 (file)
@@ -11,13 +11,15 @@ The user presses the synchronization button on the "My books" screen.
 6. Fetch changes since last sync: `PATCH https://bosh.pageplace.de/bosh/rest/sync-data`_
 7. Get list of resellers: `GET https://bosh.pageplace.de/bosh/rest/handshake/resellers`_
 8. Fetch advertisements for the main screen: `GET https://bosh.pageplace.de/bosh/rest/recommendation/xyz`_
-9. Fetch family membership information: GET https://family.pageplace.de/v1/myself
+9. Fetch family membership information: `GET https://family.pageplace.de/v1/myself`_
 
 When the user is part of a family:
 
-10. Fetch list of available dictionaries: GET https://bosh.pageplace.de/bosh/rest/dictionary/list
-11. Fetch list of family members: GET https://family.pageplace.de/v1/family
-12. Fetch list of shared books: GET https://family.pageplace.de/v1/shares
+10. Fetch list of available dictionaries: `GET https://bosh.pageplace.de/bosh/rest/dictionary/list`_
+11. Fetch list of family members: `GET https://family.pageplace.de/v1/family`_
+12. Fetch list of shared books: `GET https://family.pageplace.de/v1/shares`_
 
 
 FIXME: What happens if the inventory count is 0? Is the inventory not fetched then?
+
+FIXME: What happens if there is only one family member? Is the list of shared books fetched then?