First part of the setup process
[tolino-api-docs.git] / api / headers.rst
1 =======
2 Headers
3 =======
4
5 ``User-Agent``
6   Normal API requests:
7
8   ``Dalvik/1.6.0 (Linux; U; Android 4.4.2; tolino Build/KOT49H)``
9
10   The browser:
11
12   ``Mozilla/5.0 (Linux; Android 4.4.2; en-; tolino vision 3 HD/14.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Mobile Safari/537.36 READER OS_BUILD/KOT49H.41429.1044823``
13
14
15 bosh v1 header set
16 ==================
17 Headers common in all HTTP requests to ``https://bosh.pageplace.de/bosh/rest/...``
18 (except ``../rest/v2/``).
19
20 ``t_auth_token``
21   OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
22
23   Example: ``eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
24 ``Accept``
25   Example: ``application/json; charset=UTF-8``
26 ``m_id``
27   Probably the reseller ID
28
29   Example: ``3``
30 ``hardware_id``
31   Serial number of the ebook reader.
32
33   Second part of the serial number that can be obtained via shell::
34
35     $ getprop ro.serialno
36     60239815,665fc389ef4e47258c5db9fa7821bd19
37
38   Example: ``665fc389ef4e47258c5db9fa7821bd19``
39 ``Content-Type``
40   ``application/json; charset=UTF-8``
41
42   Always set even if there is no request body.
43 ``client_type``
44   Example: ``TOLINO_VISION_3``
45 ``client_version``
46   Example: ``14.1.0``
47
48
49 family v1 header set
50 ====================
51 ``Authorization``
52   OAuth token obtained from `POST https://thalia.de/auth/oauth2/token`_.
53
54   Example: ``Bearer eyJhbGciOiJSUzI1NiJ9.eyJhdWRpZW5jZSI6InRyZWFkZXJ2aXNpb24zIiw...``
55 ``Accept``
56   Example: ``application/json; charset=UTF-8``
57 ``Accept-Encoding``
58   ``gzip``
59 ``m_id``
60   Probably reseller ID.
61
62   Example: ``3``
63 ``Hardware-Id``
64   Serial number of the ebook reader.
65
66   Second part of the serial number that can be obtained via shell::
67
68     $ getprop ro.serialno
69     60239815,665fc389ef4e47258c5db9fa7821bd19
70
71   Example: ``665fc389ef4e47258c5db9fa7821bd19``
72 ``Content-Type``
73   ``application/json; charset=UTF-8``
74
75   Always set even if there is no request body.
76 ``client_type``
77   Example: ``TOLINO_VISION_3``
78 ``client_version``
79   Example: ``14.1.0``
80 ``Reseller-Id``
81   Example: ``3``
82 ``Cookie``
83   Multiple times:
84
85   -  ``OAUTH-JSESSIONID=3EFAEC6B69D811252C75861880C338AB.15acdb90; Path=/; Secure; HttpOnly``
86   - ``JSESSIONID=C0D8A077F6D2E13251ECDCD60FE6D18A``
87 ``Cookie2``
88   Example: ``$Version=1``