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