From ab49293254cec353bfc7c058c591c2f7e485c8fc Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 5 Jan 2020 00:57:12 +0100 Subject: [PATCH] document current_gamer --- ...developers-xxx-current_gamer.response.json | 6 +++ .../api-v1-developers-xxx-current_gamer.rst | 40 ++++++++++++++++++- .../api-v1-games-xxx-purchases.rst | 11 +++-- 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.response.json diff --git a/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.response.json b/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.response.json new file mode 100644 index 0000000..32f953a --- /dev/null +++ b/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.response.json @@ -0,0 +1,6 @@ +{ + "gamer": { + "username": "cwdev3", + "uuid": "0a6f5fc0-bf9b-42b2-a4d0-69f2c8e4d5da" + } +} diff --git a/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.rst b/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.rst index a94a9f1..14b6cd7 100644 --- a/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.rst +++ b/api/devs.ouya.tv/api-v1-developers-xxx-current_gamer.rst @@ -2,8 +2,44 @@ ``GET https://devs.ouya.tv/api/v1/developers/xxx/current_gamer`` ================================================================ -FIXME. +Fetch gamer information from within a game. Usage ===== -- At the startup of knightmare tower (when bought) +- At the startup of Knightmare Tower and Towerfall (when bought) + + +HTTP request +============ +Protocol + ``https`` +Method + ``GET`` +Host + ``devs.ouya.tv`` +Path + ``/api/v1/developers/xxx/current_gamer`` + + ``xxx`` + Developer UUID +Headers + Standard headers +GET parameters + ``auth_token`` + Same data as in standard header ``X-OUYA-AuthToken`` + + +HTTP response +============= +Status code + ``200 OK`` +Content-type + ``application/json; charset=utf-8`` + +Same data as in ``gamers/me``. + +Example +------- + +.. include:: api-v1-developers-xxx-current_gamer.response.json + :code: diff --git a/api/devs.ouya.tv/api-v1-games-xxx-purchases.rst b/api/devs.ouya.tv/api-v1-games-xxx-purchases.rst index ce1edd2..a755ea5 100644 --- a/api/devs.ouya.tv/api-v1-games-xxx-purchases.rst +++ b/api/devs.ouya.tv/api-v1-games-xxx-purchases.rst @@ -54,7 +54,7 @@ Status code Content-type ``application/json; charset=utf-8`` -Three properties: +The response is a JSON objec containing three properties: ``iv`` Base 64 encoded initialization vector for encryption @@ -63,14 +63,17 @@ Three properties: ``blob`` Base64 encoded encrypted data -The decrypted ``blob`` contains again a JSON object with the following properties: +The decrypted ``blob`` contains again a JSON object with three properties: - ``iv`` - ``key`` - ``blob`` -This blob is again a base64-encoded JSON objecct and contains the actual data: -An array of receipts/purchases. +This blob is again base64-encoded JSON and contains the actual data: +A JSON with a single property "purchases" whose value is +an array of receipts/purchases. + +Each receipt has the following properties: ``purchaseDate`` Required. Milliseconds. -- 2.30.2