Razer Forge TV registration endpoint
[ouya-store-api.git] / api / devs.ouya.tv / api-v1-gamers.rst
1 ===========================================
2 ``POST https://devs.ouya.tv/api/v1/gamers``
3 ===========================================
4
5 Register a new user and/or verify new user registration data.
6
7 This method is both used as verification during input, as well as the
8 final registration.
9
10 Razer Forge TV uses `POST https://devs.ouya.tv/api/razer/gamer`_ instead.
11
12
13 Usage
14 =====
15 #. During registration to check if data are valid
16 #. During registration to finish new user sign up and create the account
17
18
19 HTTP request
20 ============
21 Protocol
22   ``https``
23 Method
24   ``GET``
25 Host
26   ``devs.ouya.tv``
27 Path
28   ``/api/v1/gamers``
29 Headers
30   Standard headers except token parameters.
31
32   ``Content-Type``
33     ``application/x-www-form-urlencoded``
34 POST parameters
35   ``gamer[username]``
36     User name used to log in
37   ``gamer[password]``
38     User password
39   ``gamer[password_confirmation]``
40     User password, a second time
41   ``gamer[email]``
42     User e-mail address for marketing e-mails
43   ``gamer[gender]``
44     ``unknown`` | ``male`` | ``female``
45   ``gamer[email_opt_out]``
46     ``false`` | ``true``
47
48     Opt out from marketing e-mails
49   ``dryrun``
50     ``true``
51
52     If set, the user data are not registered - only verified.
53     The response then tells which fields are deemed invalid.
54
55     Not set when the user clicks "register".
56
57
58 HTTP response
59 =============
60
61 ..note:: Does not support HTTP redirects!
62
63 Success
64 -------
65 When everything is ok and the user has been registered
66 (or the data were valid when ``dryrun`` was set)
67
68 Status code
69   ``200 OK``
70 Content type
71   ``application/json; charset=utf-8``
72 Response body
73   ``{}``
74
75 Validation error
76 ----------------
77 When some of the data are deemed to be invalid.
78
79 Status code
80   ``400 Bad Request``
81 Content type
82   ``application/json; charset=utf-8``
83
84 Example:
85
86 .. include:: api-v1-gamers.response-invalid.json
87    :code: