Redeem token

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: <pre>Request representation: redeemed:true Response: 200 OK Entity body same as GET /v1/{apikey}/game/{game}/token/{token} Response if request invalid: 400 Bad Request Entity body descri...)
Line 23: Line 23:
redeemed:true,
redeemed:true,
awards: [
awards: [
-
/v1/{apikey}/game/{game1}/prize/{prize},
+
prizes: [
-
/v1/{apikey}/game/{game2}/token/{token}
+
/v1/{apikey}/game/{game1}/prize/{prize},
 +
...
 +
],
 +
tokens: [
 +
/v1/{apikey}/game/{game2}/token/{token},
 +
...
 +
]
]
]
</pre>
</pre>

Revision as of 23:39, 2 March 2009

Request representation:
redeemed:true

Response:
200 OK
Entity body same as GET /v1/{apikey}/game/{game}/token/{token}

Response if request invalid:
400 Bad Request
Entity body describing failed validations

Response if token already redeemed:
405 Conflict

Response if limit reached:
403 Forbidden

A successful redemption changes the representation of the token. This shows a redeemed token that resulted the awarding of a prize and a token to another game:

game:{game},
profile:{profile},
redeemed:true,
awards: [
  prizes: [
    /v1/{apikey}/game/{game1}/prize/{prize},
    ...
  ],
  tokens: [
    /v1/{apikey}/game/{game2}/token/{token},
    ...
  ]
]

A redeemed token that resulted in no awards:

game:{game},
profile:{profile},
redeemed:true,
awards: []

The list of awards is immediately available on the resource {profile}/awards. Tokens awarded are available on the resource {profile}/tokens until they are redeemed.

Personal tools