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