Validate and consume code

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(summary)
Line 2: Line 2:
{{RESTfulAPI
{{RESTfulAPI
|crumbs=[[API Home Page]] :: [[Code Services]]
|crumbs=[[API Home Page]] :: [[Code Services]]
-
|summary=TODO: Fill me in.
+
|summary=Code Services allows promotion builders to take advantage of ePrize's robust Code Services platform. When submitting a new promotion request, you may specify certain code configurations that will take effect in your promotion. These codes may be used for many different scenarios -- a code may be required on registration, for example, or a user may be awarded a game play if they give a valid code. The code configurations are quite extensible, please contact us if you have any questions.
}}
}}

Revision as of 14:11, 19 October 2009

Code Services API calls will not be available until October 2009.

API Home Page :: Code Services

Summary

Code Services allows promotion builders to take advantage of ePrize's robust Code Services platform. When submitting a new promotion request, you may specify certain code configurations that will take effect in your promotion. These codes may be used for many different scenarios -- a code may be required on registration, for example, or a user may be awarded a game play if they give a valid code. The code configurations are quite extensible, please contact us if you have any questions.





Example: Successfully Validate & Consume a Code

Summary

This demonstrates successfully validating and consuming a code.

Request

profile: http://{client}.api.promo.eprize.com/v1/{apikey}/profile/{uid}

Response

HTTP Status Code: 200 OK


<?xml version="1.0" encoding="UTF-8" ?>
<result ver="1.0">
  <codeResponse>
    <code>{code}</code>
    <codeClass>{codeClass}</codeClass>
  </codeResponse>
</result>

Notes

The {profile} value that is seen in the request and response of this call is the canonical URL of the profile that the token should be awarded to.

Example: Attempting to Validate & Consume a Code with no Profile

Summary

This demonstrates an unsuccessful attempt at validating & consuming a code without providing a profile (or providing a bad one).

Request

profile: foo

Response

HTTP Status Code: 400 Bad Request


<?xml version="1.0" encoding="UTF-8"?>
<result ver="1.0">
  <reason>Unable to validate the provided profile.</reason>
</result>


Example: Attempting to Validate & Consume a Code for a code class that doesn't exist

Summary

This demonstrates an unsuccessful attempt at validating & consuming a code without providing a code class (or providing a bad one).

Request

profile: http://{client}.api.promo.eprize.com/v1/{apikey}/profile/{uid}
codeClass: foo

Response

HTTP Status Code: 400 Bad Request


<?xml version="1.0" encoding="UTF-8"?>
<result ver="1.0">
  <reason>The specified code class does not exist.</reason>
</result>


Example: Attempting to Validate & Consume a Code that doesn't exist

Summary

This demonstrates an unsuccessful attempt at validating & consuming a code that doesn't exist.


Response

HTTP Status Code: 400 Bad Request


<?xml version="1.0" encoding="UTF-8"?>
<result ver="1.0">
  <reason>The specified code does not exist.</reason>
</result>


Personal tools