Redeem token

From ePrize Developers Wiki

Revision as of 13:03, 2 March 2009 by Ken-fox (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
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: [
/v1/{apikey}/game/{game1}/prize/{prize},
/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