Redeem token

From ePrize Developers Wiki

Revision as of 23:39, 2 March 2009 by Ken-fox (Talk | contribs)
Jump to: navigation, search
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