Fetch prize

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Line 10: Line 10:
|resourceargs='''apikey''': Your [[API Key]].
|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 ePrize)
+
'''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]].
'''prize''': Identifier for the prize retrieved after a win during a [[Redeem_token|token redemption]].
Line 17: Line 17:
<!-- this doesn't exists -- yee 4/7/2011
<!-- 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 ePrize is performing prize fulfilment.
+
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.

Revision as of 14:11, 31 March 2014

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