Fetch prize
From ePrize Developers Wiki
(2 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 | ||
}} | }} | ||
+ | |||
+ | <!-- 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. | ||
+ | |||
+ | |||
+ | <pre>Request representation: empty | ||
+ | |||
+ | Response: | ||
+ | 200 OK | ||
+ | game: {game}, | ||
+ | profile: {profile}, | ||
+ | description: {prize-description}, | ||
+ | actions: [ | ||
+ | claim: {prize-center-url} | ||
+ | ] | ||
+ | |||
+ | Response if prize doesn't exist: | ||
+ | 404 Not Found | ||
+ | </pre> | ||
+ | --> | ||
{{RESTfulExample | {{RESTfulExample | ||
Line 27: | Line 59: | ||
</result> | </result> | ||
}} | }} | ||
- | |||
- | == Extra Notes == | ||
- | |||
- | The {profile} value identifies the profile that the prize was awarded to, or null if the prize has not been awarded. The {prize-name} value is the name of the prize for tracking purposes and may not make sense to a consumer. The client is expected to translate the name before displaying it. | ||
- | |||
- | The claim action represents a resource that will help a consumer claim the prize. This action is only present if ePrize is performing prize fulfilment. | ||
- | |||
- | |||
- | <pre>Request representation: empty | ||
- | |||
- | Response: | ||
- | 200 OK | ||
- | game: {game}, | ||
- | profile: {profile}, | ||
- | description: {prize-description}, | ||
- | actions: [ | ||
- | claim: {prize-center-url} | ||
- | ] | ||
- | |||
- | Response if prize doesn't exist: | ||
- | 404 Not Found | ||
- | </pre> |
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>