API Home Page

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(ePrize Web Services API)
Line 14: Line 14:
== ePrize Web Services API ==
== ePrize Web Services API ==
 +
<div class="api_table">
 +
[[API Request/Response]]
 +
</div>
 +
<div class="api_table">
 +
[[API Security]]
 +
</div>
 +
<div class="api_table">
 +
[[API Events and Logging]]
 +
</div>
 +
<div class="api_table">
 +
[[Promotions]]
{|
{|
-
| [[API Request/Response]]
+
! Call
 +
! Examples
 +
! Description
|-
|-
-
| [[API Security]]
+
| [[Fetch promotions]]
 +
| GET /v1
 +
|
|-
|-
-
| [[API Events and Logging]]
+
|}
 +
</div>
 +
<div class="api_table">
 +
[[Profiles]]
 +
{|
 +
! Call
 +
! Examples
 +
! Description
|-
|-
-
| [[Promotions]]
+
| [[Create profile]]
 +
| POST /v1/{apikey}/profiles
 +
|
|-
|-
-
| ... [[Fetch promotions]] || GET /v1
+
| [[Fetch profile by key]]
 +
| GET /v1/{apikey}/profile({key})/{value}
 +
|
|-
|-
-
| [[Profiles]]
+
| [[Fetch profile]]
 +
| GET /v1/{apikey}/profile/{uid}
 +
|
|-
|-
-
| ... [[Create profile]] || POST /v1/{apikey}/profiles
+
| [[Fetch unredeemed tokens]]
 +
| GET /v1/{apikey}/profile/{uid}/tokens
 +
|
|-
|-
-
| ... [[Fetch profile by key]] || GET /v1/{apikey}/profile({key})/{value}
+
| [[Fetch awards]]
 +
| GET /v1/{apikey}/profile/{uid}/awards
 +
|
|-
|-
-
| ... [[Fetch profile]] || GET /v1/{apikey}/profile/{uid}
+
|}
 +
</div>
 +
<div class="api_table">
 +
[[Games and Awards]]
 +
{|
 +
! Call
 +
! Examples
 +
! Description
|-
|-
-
| ... [[Fetch unredeemed tokens]] || GET /v1/{apikey}/profile/{uid}/tokens
+
| [[Award token]]
 +
| POST /v1/{apikey}/game/{game}/tokens
 +
|
|-
|-
-
| ... [[Fetch awards]] || GET /v1/{apikey}/profile/{uid}/awards
+
| [[Fetch token]]
 +
| GET /v1/{apikey}/game/{game}/token/{token}
 +
|
|-
|-
-
| [[Games and Awards]]
+
| [[Redeem token]]
 +
| POST /v1/{apikey}/game/{game}/token/{token}
 +
|
|-
|-
-
| ... [[Award token]] || POST /v1/{apikey}/game/{game}/tokens
+
| [[Fetch prize]]
 +
| GET /v1/{apikey}/game/{game}/prize/{prize}|}
 +
|
|-
|-
-
| ... [[Fetch token]] || GET /v1/{apikey}/game/{game}/token/{token}
+
|}
 +
</div>
 +
<div class="api_table">
 +
[[Mail]]
 +
{|
 +
! Call
 +
! Examples
 +
! Description
|-
|-
-
| ... [[Redeem token]] || POST /v1/{apikey}/game/{game}/token/{token}
+
| [[Send email]]
 +
| POST /v1/{apikey}/email/{template-id}
 +
|
|-
|-
-
| ... [[Fetch prize]] || GET /v1/{apikey}/game/{game}/prize/{prize}
+
|}
-
|-
+
</div>
-
| [[Mail]]
+
<div class="api_table">
-
|-
+
[[CAPTCHA]]
-
| ... [[Send email]] || POST /v1/{apikey}/email/{template-id}
+
{|
 +
! Call
 +
! Examples
 +
! Description
|-
|-
-
| [[CAPTCHA]]
+
| [[Create CAPTCHA challenge]]
 +
| POST /v1/{apikey}/captcha
 +
|
|-
|-
-
| ... [[Create CAPTCHA challenge]] || POST /v1/{apikey}/captcha
 
|-
|-
-
| ... [[Fetch CAPTCHA challenge]] || GET /v1/{apikey}/captcha/{challenge-id}
+
| [[Fetch CAPTCHA challenge]]
 +
| GET /v1/{apikey}/captcha/{challenge-id}
 +
|
|-
|-
-
| [[API Debugging]]
 
|}
|}
 +
</div>
 +
<div class="api_table">
 +
[[API Debugging]]
 +
</div>
== ePrize Promotion Client Libraries ==
== ePrize Promotion Client Libraries ==
* [[Flash ActionScript 3.0 Promotion Library]]
* [[Flash ActionScript 3.0 Promotion Library]]

Revision as of 14:26, 3 March 2009

ePrize Web Services API uses a REST architecture for communication between your client and the ePrize servers. This is the same architecture used by the web, so you can explore the API with a web browser. While exploring the API, its basic features become clear:

  • All URLs represent resources available to you. URLs are never actions.
  • All actions on resources are basic HTTP methods such as GET, POST and PUT.
  • All responses to your actions use basic HTTP status codes such as "200 OK" and "400 Bad Request".
  • All responses include information on sub-resources and actions that may be performed.
  • All responses use simple, regular media types that can be easily processed.
  • All GET and PUT actions are idempotent; POST actions are not.

These features come at a cost however: the API consists of very small building blocks that do not directly provide the promotion services you expect in an ePrize promotion. For example, game plays are not automatically awarded upon login—there isn't even a login call! If you want to build clients using these more specific promotion features, you must use a client library. A library assembles the small building blocks into bigger features that you can reuse when building your promotion.

ePrize Web Services API

Promotions

Call Examples Description
Fetch promotions GET /v1

Profiles

Call Examples Description
Create profile POST /v1/{apikey}/profiles
Fetch profile by key GET /v1/{apikey}/profile({key})/{value}
Fetch profile GET /v1/{apikey}/profile/{uid}
Fetch unredeemed tokens GET /v1/{apikey}/profile/{uid}/tokens
Fetch awards GET /v1/{apikey}/profile/{uid}/awards

Games and Awards

Call Examples Description
Award token POST /v1/{apikey}/game/{game}/tokens
Fetch token GET /v1/{apikey}/game/{game}/token/{token}
Redeem token POST /v1/{apikey}/game/{game}/token/{token}
Fetch prize }

Mail

Call Examples Description
Send email POST /v1/{apikey}/email/{template-id}

CAPTCHA

Call Examples Description
Create CAPTCHA challenge POST /v1/{apikey}/captcha
Fetch CAPTCHA challenge GET /v1/{apikey}/captcha/{challenge-id}

ePrize Promotion Client Libraries

Personal tools