Work in progress #5: Uploading and deleting own ebooks
[tolino-api-docs.git] / api / thalia-auth-oauth2-token-post.rst
1 ============================================
2 ``POST https://thalia.de/auth/oauth2/token``
3 ============================================
4 Step 4 of the `Login process`_.
5
6 Uses:
7
8 1. Log in to obtain an access token.
9 2. Generate access token from a refresh token.
10
11
12 Request
13 =======
14 GET parameters
15   ``client_secret``
16     Provided in the reseller configuration.
17
18     Example: ``gU5a7CA9``
19
20 Headers
21   ``Content-Type``
22     ``application/x-www-form-urlencoded``
23   ``User-Agent``
24     ``DT_EINK_10_NETRONIX DT_EINK_UPD_PP_14.1.0``
25   ``Cookie``:
26     The ``refresh_token`` request sends no cookie.
27
28     Example: ``gcor=SIDYBbxYkmvUvoO8hy@2Sfx4QAAA9o; ab_bucket=9; ab_container=3; OAUTH-JSESSIONID=9C95C20ECEE74164E76F60C205147822.15acdb90``
29   ``Cookie2``
30     ``$Version=1``
31
32 POST parameters: New token
33   ``grant_type``:
34     ``authorization_code``
35   ``redirect_uri``
36     ``epublishing://login``
37
38     The e-reader internal login process
39   ``code``
40     Obtained from login form page redirect.
41
42     Example: ``GK6jDC``
43   ``client_id``
44     Example: ``treadervision3``
45
46 POST parameters: Refresh token
47   ``grant_type``
48     ``refresh_token``
49   ``refresh_token``
50     Obtained in the last OAuth token response.
51
52     Example: ``91132a11-dd87-4450-bf16-a63dff1da4d1``
53   ``client_id``
54     Example: ``treadervision3``
55
56
57
58 Response
59 ========
60 HTTP status code ``200 OK``
61
62 .. include:: thalia-auth-oauth2-token-post.response.json
63    :code: