Award sweepstakes entry

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
<span style="color: red">THIS WILL NOT BE AVAILABLE UNTIL MAY 19TH.</span>
+
<span style="color: red">THIS WILL NOT BE AVAILABLE UNTIL MAY 19TH, 2009.</span>
{{RESTfulAPI
{{RESTfulAPI

Revision as of 18:22, 11 May 2009

THIS WILL NOT BE AVAILABLE UNTIL MAY 19TH, 2009.


API Home Page :: Games and Awards

Summary

TODO: Fill me in.





Example: Successfully Awarding a Sweeps Entry

Summary

This demonstrates successfully awarding a sweepstakes entry to a user.

Request

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

Response

HTTP Status Code: 201 Created


<?xml version="1.0" encoding="UTF-8" ?>
<result ver="ePrize Web Services 1.0">
  <sweepsEntry>
    <whenEarned>{date-time}</whenEarned>
    <game>{game}</game>
  </sweepsEntry>
</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.

This URL can be easily attacked by the owner of a profile because the owner knows his own canonical profile URL. Award limits create an upper bound on the attack damage.

Example: Awarding Sweeps Entry to Invalid Profile

Summary

This demonstrates attempting to award a sweepstakes entry to a profile resource that doesn't exist.

Request

profile: foo

Response

HTTP Status Code: 400 Bad Request


<?xml version="1.0" encoding="UTF-8"?>
<result ver="ePrize Web Services 1.0">
  <result>Unable to validate the provided profile.</result>
  <status>0</status>
</result>


Example: Awarding Sweeps Entry to a Limited Profile

Summary

This demonstrates attempting to overaward sweepstakes entries to a user. For example, the promotion is setup to give out 3 sweeps entries per day per user, and this would be a users 4th attempt in one day.


Response

HTTP Status Code: 403 Forbidden


<?xml version="1.0" encoding="UTF-8"?>
<result ver="ePrize Web Services 1.0">
</result>


Personal tools