Fetch token

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Current revision (14:20, 31 March 2014) (edit) (undo)
 
(8 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=TODO: Fill me in.
+
|summary=Verify a token. A valid token must be used to play the instant win game, and this can be used to verify validity of stored token IDs.
 +
 
 +
This resource will return a status of ''200 OK'' with a valid token and ''404 Not Found'' with an invalid token.
 +
 
 +
For more information on tokens, see [[Games_and_Awards|Games and Awards]]
 +
|resource=/v1/{apikey}/game/{game}/token/{token}
 +
|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)
 +
 
 +
'''token''': Token ID retrieved from response from [[Award_token|awarding a token]]
 +
|paramsrequired=None
}}
}}
Line 9: Line 21:
|responsecode=200 OK
|responsecode=200 OK
|response=<?xml version="1.0" encoding="UTF-8" ?>
|response=<?xml version="1.0" encoding="UTF-8" ?>
-
<result ver="ePrize Web Services 1.0">
+
<result ver="1.0">
-
<result>
+
<token>
-
<token>
+
<id>1</id>
-
<id>1</id>
+
<user>Bill</user>
-
<user>Bill</user>
+
<game>12345-1234-1234-1234</game>
-
<game>12345-1234-1234-1234</game>
+
</token>
-
</token>
+
-
</result>
+
-
<status>1</status>
+
</result>
</result>
}}
}}
Line 26: Line 35:
|responsecode=404 Not Found
|responsecode=404 Not Found
|response=<?xml version="1.0" encoding="UTF-8"?>
|response=<?xml version="1.0" encoding="UTF-8"?>
-
<result ver="ePrize Web Services 1.0">
+
<result />
-
<result/>
+
-
<status>0</status>
+
-
</result>
+
}}
}}
- 
-
<pre>Request representation: empty
 
- 
-
Response:
 
-
200 OK
 
-
game: {game},
 
-
profile: {profile},
 
-
redeemed: {redeemed?},
 
-
awards: [
 
-
prizes: [
 
-
/v1/{apikey}/game/{game1}/prize/{prize},
 
-
...
 
-
],
 
-
tokens: [
 
-
/v1/{apikey}/game/{game2}/token/{token},
 
-
...
 
-
]
 
-
]
 
-
actions: [
 
-
redeem: /v1/{apikey}/game/{game}/token/{token}
 
-
]
 
- 
-
Response if token doesn't exist:
 
-
404 Not Found
 
-
</pre>
 
- 
-
The redeem action does not appear on tokens that may not be redeemed.
 

Current revision

API Home Page :: Games and Awards

Summary

Verify a token. A valid token must be used to play the instant win game, and this can be used to verify validity of stored token IDs.

This resource will return a status of 200 OK with a valid token and 404 Not Found with an invalid token.

For more information on tokens, see Games and Awards

Resource

/v1/{apikey}/game/{game}/token/{token}

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)

token: Token ID retrieved from response from awarding a token

Parameters Required

None



Example: Requesting A Valid Token

Summary

This demonstrates a good request for a token that exists.


Response

HTTP Status Code: 200 OK


<?xml version="1.0" encoding="UTF-8" ?>
<result ver="1.0">
  <token>
    <id>1</id>
    <user>Bill</user>
    <game>12345-1234-1234-1234</game>
  </token>
</result>


Example: Requesting An Invalid Token

Summary

This demonstrates a good request for a token that does not exist.


Response

HTTP Status Code: 404 Not Found


<?xml version="1.0" encoding="UTF-8"?>
<result />


Personal tools