*********
.. include:: api/usecase-login.rst
.. include:: api/usecase-sync.rst
+.. include:: api/usecase-upload.rst
API calls
*********
+.. include:: api/pageplace.bosh-bosh-rest-content-delete.rst
+.. include:: api/pageplace.bosh-bosh-rest-cover.rst
+.. include:: api/pageplace.bosh-bosh-rest-cover-xxx-yyy.rst
.. 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-recommendation-xyz.rst
.. include:: api/pageplace.bosh-bosh-rest-sync-data.rst
.. include:: api/pageplace.bosh-bosh-rest-time.rst
+.. include:: api/pageplace.bosh-bosh-rest-upload.rst
.. 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
--- /dev/null
+{
+ "contentDeleteRequest": {
+ "deleteAll": true,
+ "content": [
+ {
+ "deliverableId": "bosh_3_395490135492823841139311838"
+ }
+ ]
+ }
+}
--- /dev/null
+===========================================================
+``POST https://bosh.pageplace.de/bosh/rest/content/delete``
+===========================================================
+Delete a book from the cloud.
+
+
+Request
+=======
+
+Example:
+
+.. include:: pageplace.bosh-bosh-rest-content-delete.request.json
+ :code:
+
+
+Response
+========
+HTTP status code: ``200 OK``.
+
+No content.
--- /dev/null
+=========================================================
+``GET https://bosh.pageplace.de/bosh/rest/cover/xxx/yyy``
+=========================================================
+Fetch the cover for a manually uploaded book.
+
+Part of the `upload process`_.
+
+Request
+=======
+Only three headers. Unusual.
+
+Full URL example: ``https://bosh.pageplace.de/bosh/rest/cover/39549013/bosh_3_395490135492823841139311838?size=WS-B04``
+
+URL path parts
+ ``xxx``
+ 8 bytes of the publication ID
+
+ Example: ``39549013``
+ ``yyy``
+ Publication ID
+
+ Example: ``bosh_3_395490135492823841139311838``
+Header
+ ``m_id``
+ Maybe reseller ID?
+
+ Example: ``3``
+ ``Host``
+ ``bosh.pageplace.de``
+ ``Connection``
+ ``Keep-Alive``
+
+GET parameters
+ ``size``
+ Image size (so we get a scaled version)
+
+ Known values:
+
+ - ``WS-B04``
+
+
+Response
+========
+HTTP status code: ``200 OK``.
+
+Binary cover image data.
--- /dev/null
+{
+ "ResponseInfo": {
+ "message": "Cover uploaded successfully.",
+ "requestId": "41d3243f-6d7a-489a-8d98-b3f7f55cb794",
+ "responseStatus": 317,
+ "serviceName": "cover[POST]"
+ }
+}
--- /dev/null
+==================================================
+``POST https://bosh.pageplace.de/bosh/rest/cover``
+==================================================
+Upload the cover for an uploaded ``.epub`` file.
+
+Step 2 of the `upload process`_.
+
+Request
+=======
+Header
+ ``Content-Type``
+ ``multipart/form-data; boundary="Boundary1612163626238"``
+
+Request body
+ Control data
+ Header
+ ``Content-Disposition: form-data; name="control"``
+ Content
+ JSON
+ ``{"filesize":334499,"transactionId":"84401550-d933-4f12-b168-87421835bada"}``
+
+ The transaction ID is different than the one for the epub upload.
+ File data
+ Header
+ ``Content-Disposition: form-data; name="file"; filename="1092560016"``
+ Content
+ Binary cover image contents
+ Book reference
+ Header
+ ``Content-Disposition: form-data; name="deliverableId"``
+ Content
+ ``deliverableId`` of the epub upload response.
+
+ Example: ``bosh_3_395490135492823841139311838``
+
+
+
+Response
+========
+HTTP status code: ``200 OK``.
+
+Meta data entry for the uploaded cover.
+
+Example:
+
+.. include:: pageplace.bosh-bosh-rest-cover.response.json
+ :code:
--- /dev/null
+{
+ "metadata": {
+ "deliverableId": "bosh_3_395490135492823841139311838",
+ "title": "MacBest",
+ "subtitle": null,
+ "author": "Terry Pratchett",
+ "publisher": "Heyne",
+ "isbn": null,
+ "edition": null,
+ "pages": 0,
+ "issued": 0,
+ "language": "de",
+ "format": "application/epub+zip",
+ "epubVersion": "2.0"
+ }
+}
--- /dev/null
+===================================================
+``POST https://bosh.pageplace.de/bosh/rest/upload``
+===================================================
+Upload a new book ``.epub`` file.
+
+Step 1 of the `upload process`_.
+
+
+Request
+=======
+Header
+ FIXME: Headers
+
+ ``Content-Type``
+ ``multipart/form-data; boundary="Boundary1612163626238"``
+
+Request body
+ Control data
+ Header
+ ``Content-Disposition: form-data; name="control"``
+ Content
+ JSON
+ ``{"filesize":334499,"transactionId":"84401550-d933-4f12-b168-87421835bada"}``
+ File data
+ Header
+ ``Content-Disposition: form-data; name="file"; filename="MacBest by Pratchett Terry.epub"``
+ Content
+ Binary .epub file contents
+
+
+Response
+========
+HTTP status code: ``200 OK``.
+
+Meta data entry for the uploaded file.
+
+Example:
+
+.. include:: pageplace.bosh-bosh-rest-upload.response.json
+ :code:
``User-Agent``
``DT_EINK_10_NETRONIX DT_EINK_UPD_PP_14.1.0``
``Cookie``:
+ The ``refresh_token`` request sends no cookie.
+
Example: ``gcor=SIDYBbxYkmvUvoO8hy@2Sfx4QAAA9o; ab_bucket=9; ab_container=3; OAUTH-JSESSIONID=9C95C20ECEE74164E76F60C205147822.15acdb90``
``Cookie2``
``$Version=1``
-POST parameters
+POST parameters: New token
``grant_type``:
``authorization_code``
``redirect_uri``
``client_id``
Example: ``treadervision3``
+POST parameters: Refresh token
+ ``grant_type``
+ ``refresh_token``
+ ``refresh_token``
+ Obtained in the last OAuth token response.
+
+ Example: ``91132a11-dd87-4450-bf16-a63dff1da4d1``
+ ``client_id``
+ Example: ``treadervision3``
+
+
Response
========
--- /dev/null
+==============
+Upload process
+==============
+The user wants to upload a book on the reader to the cloud.
+
+1. Upload the epub file: `POST https://bosh.pageplace.de/bosh/rest/upload`_
+2. Upload the cover image: `POST https://bosh.pageplace.de/bosh/rest/cover`_
+3. Fetch the number of books in the cloud: `GET https://bosh.pageplace.de/bosh/rest/inventory/count`_
+4. Fetch the current date/time: `GET https://bosh.pageplace.de/bosh/rest/time`_
+5. Fetch changes since last sync: `PATCH https://bosh.pageplace.de/bosh/rest/sync-data`_
+
+Some time later:
+
+6. Download the cover of the uploaded book: `GET https://bosh.pageplace.de/bosh/rest/cover/xxx/yyy`_