Fetch prize

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Current revision (14:21, 31 March 2014) (edit) (undo)
 
(6 intermediate revisions not shown.)
Line 1: Line 1:
 +
{{RESTfulAPI
 +
|crumbs=[[API Home Page]] :: [[Games and Awards]]
 +
|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
<pre>Request representation: empty
Line 5: Line 26:
game: {game},
game: {game},
profile: {profile},
profile: {profile},
-
name: {prize-name},
+
description: {prize-description},
actions: [
actions: [
claim: {prize-center-url}
claim: {prize-center-url}
]
]
-
Response if token doesn't exist:
+
Response if prize doesn't exist:
404 Not Found
404 Not Found
</pre>
</pre>
 +
-->
-
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.
+
{{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>
 +
}}
-
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.
+
{{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>


Personal tools