More work on 204 and profile
[playjam-gamestick-api-docs.git] / api / l2.gamestickservices.net / api-rest-connect-stick-stick-xxx-view.json.rst
1 ============================================================================
2 ``POST l2.gamestickservices.net/api/rest/connect/stick/stick/xxx/view.json``
3 ============================================================================
4
5 Used for several things:
6
7 1. Network connection check
8 2. Fetch registration code and session ID for this gamestick.
9 3. Fetch information about games and their display in the main menu
10
11
12 HTTP request
13 ============
14 When the GameStick is not registered yet, then this URL is fetched
15 every 5 seconds.
16 Once registered, it is fetched every 2 minutes.
17
18 Method
19   ``POST``
20
21   Firmware 0.0.53 uses ``GET``.
22
23   ``DatabaseService.ServiceCore`` can be put into GET mode in Firmware 2071,
24   in that case, GET will be used as well.
25 Protocol
26   ``http``
27 Host
28   ``l2.gamestickservices.net``
29
30   Firmware 0.0.53 uses ``db.gamestickservices.net``.
31 Path
32   ``/api/rest/connect/stick/stick/xxx/view.json``
33
34   ``xxx``
35     Hardware-ID, e.g. ``ac:db:da:09:18:5c``
36
37   ``;jsessionid=yyy``
38     In GET mode
39 POST parameters
40   None
41 Cookies
42   ``JSESSIONID``
43     Session ID, only when available (not empty)
44
45     In POST mode only
46   ``AWSELB``
47     When available
48
49     In POST mode only.
50
51
52 HTTP response
53 =============
54 When used for connection check, the response must contain
55 one of the following strings (no whitespace after ``:``)::
56
57   "status":"CONNECTION_IN_PROGRESS"
58   "status":"CONNECTED"
59
60
61 Not registered yet - ``CONNECTION_IN_PROGRESS``
62 -----------------------------------------------
63 Status code
64    ``200 OK``
65
66 .. include:: api-rest-connect-stick-stick-xxx-view.json.response-unregistered.json
67    :code:
68
69
70 Registration complete - ``CONNECTED``
71 -------------------------------------
72 Status code
73    ``200 OK``
74
75 .. include:: api-rest-connect-stick-stick-xxx-view.json.response-registered.json
76    :code:
77
78
79
80 Usage
81 =====
82 - ``com.playjam.gamestick.WifiTools.ChecksFragment#doDatabaseConnect()``
83
84   To check if a network connection is available.
85   Only uses ``l2.gamestickservices.net``.