Fetch prize
From ePrize Developers Wiki
(5 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
{{RESTfulAPI | {{RESTfulAPI | ||
|crumbs=[[API Home Page]] :: [[Games and Awards]] | |crumbs=[[API Home Page]] :: [[Games and Awards]] | ||
- | |summary= | + | |summary=Look up information about a prize. The [[Redeem_token|redemption of a token]] will return a prize in the response if the user is a winner, but will not provide information about the prize itself. This resource is used to return information on a prize. |
- | + | ||
- | + | '''Important''': a ''200 OK'' response from this resource does not indicate a user has won the prize. A win should only be interpreted as such during [[Redeem_token|token redemption]]. | |
- | + | ||
- | + | ||
- | | | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | Also note that the prize description may not make sense to a consumer. The created application is expected to translate the name appropriately before displaying it to the user. | |
- | + | |resource=/v1/{apikey}/game/{game}/prize/{prize} | |
- | + | |methods=GET | |
- | | | + | |resourceargs='''apikey''': Your [[API Key]]. |
- | | | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | '''gameId''': Game Identifier for the Sweepstakes into which the entry will be awarded. (A constant value provided to you by HelloWorld) | |
- | + | '''prize''': Identifier for the prize retrieved after a win during a [[Redeem_token|token redemption]]. | |
+ | |paramsrequired=None | ||
+ | }} | ||
- | The claim action represents a resource that will help a consumer claim the prize. This action is only present if | + | <!-- this doesn't exists -- yee 4/7/2011 |
+ | The claim action represents a resource that will help a consumer claim the prize. This action is only present if HelloWorld is performing prize fulfilment. | ||
Line 45: | Line 26: | ||
game: {game}, | game: {game}, | ||
profile: {profile}, | profile: {profile}, | ||
- | + | description: {prize-description}, | |
actions: [ | actions: [ | ||
claim: {prize-center-url} | claim: {prize-center-url} | ||
] | ] | ||
- | Response if | + | Response if prize doesn't exist: |
404 Not Found | 404 Not Found | ||
</pre> | </pre> | ||
+ | --> | ||
+ | |||
+ | {{RESTfulExample | ||
+ | |title=Requesting a Valid Prize | ||
+ | |summary=This demonstrates a good request for a prize that exists. | ||
+ | |responsecode=200 OK | ||
+ | |response=<?xml version="1.0" encoding="UTF-8"?> | ||
+ | <result ver="1.0"> | ||
+ | <prize> | ||
+ | <id>{prize}</id> | ||
+ | <description>{prize-description}</description> | ||
+ | <game>{game}</game> | ||
+ | </prize> | ||
+ | </result> | ||
+ | }} | ||
+ | |||
+ | {{RESTfulExample | ||
+ | |title=Requesting An Invalid Prize | ||
+ | |summary=This demonstrates a good request for a prize that does not exist. | ||
+ | |responsecode=404 Not Found | ||
+ | |response=<?xml version="1.0" encoding="UTF-8"?> | ||
+ | <result ver="1.0"> | ||
+ | <status>0</status> | ||
+ | </result> | ||
+ | }} |
Current revision
API Home Page :: Games and Awards
Summary
Look up information about a prize. The redemption of a token will return a prize in the response if the user is a winner, but will not provide information about the prize itself. This resource is used to return information on a prize.
Important: a 200 OK response from this resource does not indicate a user has won the prize. A win should only be interpreted as such during token redemption.
Also note that the prize description may not make sense to a consumer. The created application is expected to translate the name appropriately before displaying it to the user.
Resource
/v1/{apikey}/game/{game}/prize/{prize}
Valid Methods
GET
Resource Arguments
Note: resource arguments are always required.
apikey: Your API Key.
gameId: Game Identifier for the Sweepstakes into which the entry will be awarded. (A constant value provided to you by HelloWorld)
prize: Identifier for the prize retrieved after a win during a token redemption.
Parameters Required
None
Example: Requesting a Valid Prize
Summary
This demonstrates a good request for a prize that exists.
Response
HTTP Status Code: 200 OK
<?xml version="1.0" encoding="UTF-8"?> <result ver="1.0"> <prize> <id>{prize}</id> <description>{prize-description}</description> <game>{game}</game> </prize> </result>
Example: Requesting An Invalid Prize
Summary
This demonstrates a good request for a prize that does not exist.
Response
HTTP Status Code: 404 Not Found
<?xml version="1.0" encoding="UTF-8"?> <result ver="1.0"> <status>0</status> </result>