API Home Page

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(ePrize Web Services API)
Current revision (17:37, 2 December 2014) (edit) (undo)
m
 
(24 intermediate revisions not shown.)
Line 1: Line 1:
-
<div style="float:right">http://code.eprize.com/wiki/images/6/68/EPrize_API.gif</div>
+
'''New to HelloWorld Web Services?''' Read this first: [[Getting Started]]
-
ePrize Web Services API uses a [[Wikipedia:Representational State Transfer|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:
+
<!--<div style="float:right">http://code.eprize.com/wiki/images/6/68/EPrize_API.gif</div>-->
 +
 
 +
HelloWorld Web Services API uses a [[Wikipedia:Representational State Transfer|REST]] architecture for communication between your client and the HelloWorld 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 URLs represent resources available to you. URLs are never actions.
Line 10: Line 12:
* All GET and PUT actions are idempotent; POST actions are not.
* 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&mdash;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.
+
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 HelloWorld promotion. For example, game plays are not automatically awarded upon login&mdash;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.
 +
 
 +
'''It is important to note that all communication to and from the HelloWorld Web Services API uses UTF-8 encoding.'''
 +
 
 +
'''It is important to note that the HTTP verb OPTIONS for CORS is not currently supported by default. Please reach out to your HelloWorld contact if you require this functionality'''
-
== ePrize Web Services API ==
+
== HelloWorld Web Services API ==
<div class="api_table">
<div class="api_table">
-
[[API Request/Response]]
+
[[API Request/Response|API Request and Response Overview]]
</div>
</div>
<div class="api_table">
<div class="api_table">
-
[[API Security]]
+
[[API Security|API Security Overview]]
 +
</div>
 +
<div class="api_table">
 +
[[API Fraud Prevention]]
</div>
</div>
<div class="api_table">
<div class="api_table">
[[API Events and Logging]]
[[API Events and Logging]]
 +
</div>
 +
<div class="api_table">
 +
[[API Debugging]]
 +
{|
 +
|-
 +
| [[Output communication test]]
 +
| GET
 +
| /v1/{apikey}/test/communication
 +
|-
 +
| [[Input communication test]]
 +
| POST
 +
| /v1/{apikey}/test/communication
 +
|-
 +
| [[Input URL communication test]]
 +
| PUT
 +
| /v1/{apikey}/test/communication/{value}
 +
|
 +
|-
 +
| [[Error response test]]
 +
| PUT
 +
| /v1/{apikey}/test/communication
 +
|-
 +
|}
</div>
</div>
<div class="api_table">
<div class="api_table">
Line 28: Line 60:
|-
|-
| [[Create profile]]
| [[Create profile]]
-
| POST /v1/{apikey}/profiles
+
| POST
-
|
+
| /v1/{apikey}/profiles
|-
|-
| [[Fetch profile by key]]
| [[Fetch profile by key]]
-
| GET /v1/{apikey}/profile({key})/{value}
+
| GET
-
|
+
| /v1/{apikey}/profile({key})/{value}
|-
|-
| [[Fetch profile]]
| [[Fetch profile]]
-
| GET /v1/{apikey}/profile/{uid}
+
| GET
-
|
+
| /v1/{apikey}/profile/{uid}
 +
|-
 +
|}
 +
</div>
 +
<div class="api_table">
 +
[[CAPTCHA]]
 +
{|
 +
|-
 +
| [[Create CAPTCHA challenge]]
 +
| POST
 +
| /v1/{apikey}/captcha
 +
|-
 +
| [[Fetch CAPTCHA challenge]]
 +
| GET
 +
| /v1/{apikey}/captcha/{challenge-id}
 +
|-
 +
| [[Validating_CAPTCHA_challenge_secret]]
 +
|
 +
|
|-
|-
|}
|}
Line 46: Line 96:
|-
|-
| [[Award sweepstakes entry]]
| [[Award sweepstakes entry]]
-
| POST /v1/{apikey}/game/{gameid}/sweeps
+
| POST
-
|
+
| /v1/{apikey}/game/{gameid}/sweeps
|-
|-
| [[Award token|Award instant win token]]
| [[Award token|Award instant win token]]
-
| POST /v1/{apikey}/game/{gameid}/tokens
+
| POST
-
|
+
| /v1/{apikey}/game/{gameid}/tokens
|-
|-
| [[Fetch token]]
| [[Fetch token]]
-
| GET /v1/{apikey}/game/{gameid}/token/{tokenid}
+
| GET
-
|
+
| /v1/{apikey}/game/{gameid}/token/{tokenid}
|-
|-
| [[Redeem token]]
| [[Redeem token]]
-
| POST /v1/{apikey}/game/{gameid}/token/{tokenid}
+
| POST
-
|
+
| /v1/{apikey}/game/{gameid}/token/{tokenid}
|-
|-
| [[Fetch prize]]
| [[Fetch prize]]
-
| GET /v1/{apikey}/game/{gameid}/prize/{prizeid}
+
| GET
-
|
+
| /v1/{apikey}/game/{gameid}/prize/{prizeid}
|-
|-
|}
|}
Line 72: Line 122:
|-
|-
| [[Send email]]
| [[Send email]]
-
| POST /v1/{apikey}/email/{template-id}
+
| POST
-
|
+
| /v1/{apikey}/email/{template-id}
-
|-
+
-
|}
+
-
</div>
+
-
<div class="api_table">
+
-
[[CAPTCHA]]
+
-
{|
+
-
|-
+
-
| [[Create CAPTCHA challenge]]
+
-
| POST /v1/{apikey}/captcha
+
-
|
+
-
|-
+
-
|-
+
-
| [[Fetch CAPTCHA challenge]]
+
-
| GET /v1/{apikey}/captcha/{challenge-id}
+
-
|
+
|-
|-
|}
|}
Line 97: Line 132:
|-
|-
| [[Validate and consume code]]
| [[Validate and consume code]]
-
| POST /v1/{apikey}/code/{codeClass}/{code}
+
| POST
-
|
+
| /v1/{apikey}/code/{codeClass}/{code}
|-
|-
|}
|}
</div>
</div>
<div class="api_table">
<div class="api_table">
-
[[Contest]]
+
[[Contest API|Contest]]
{|
{|
|-
|-
-
| see: http://code.eprize.com/wiki/index.php/Contest_API
+
| [[Photo Upload Key]]
-
|
+
| POST
-
|
+
| /v1/{apikey}/contest/photo_upload_key
|-
|-
-
|}
+
| [[Enter Contest]]
-
</div>
+
| POST
-
<div class="api_table">
+
| /v1/{apikey}/contest/entry
-
[[API Debugging]]
+
-
{|
+
|-
|-
-
| [[Output communication test]]
+
| [[Fetch a Contest Entry]]
-
| GET /v1/{apikey}/test/communication
+
| GET
-
|
+
| /v1/{apikey}/contest/entry/{entryId}
|-
|-
-
| [[Input communication test]]
+
| [[Get All Contest Entries for a Profile]]
-
| POST /v1/{apikey}/test/communication
+
| GET
-
|
+
| /v1/{apikey}/profile/{profileId}.{webkey}/contest/entry
|-
|-
-
| [[Input URL communication test]]
+
| [[Rate a Contest Entry]]
-
| PUT /v1/{apikey}/test/communication/{value}
+
| POST
-
|
+
| /v1/{apikey}/contest/entry/{entryId}/rate
|-
|-
-
| [[Error response test]]
+
| [[Tattle on a Contest Entry]]
-
| PUT /v1/{apikey}/test/communication
+
| POST
-
|
+
| /v1/{apikey}/contest/entry/{entryId}/tattle
 +
|-
 +
| [[Vote on a Contest Entry]]
 +
| POST
 +
| /v1/{apikey}/contest/entry/{entryId}/vote
|-
|-
 +
| [[Send a Contest Entry Link]]
 +
| POST
 +
| /v1/{apikey}/contest/entry/{entryId}/send_a_link
 +
|-
 +
| [[Browse Contest Gallery]]
 +
| GET
 +
| /v1/{apikey}/contest/gallery
 +
|-
 +
| [[Fetch Contest Leaderboard]]
 +
| GET
 +
| /v1/{apikey}/contest/most-popular
|}
|}
</div>
</div>
-
== ePrize Promotion Client Libraries ==
+
<!-- I DONT EXIST
-
 
+
|-
-
* [[Flash ActionScript 3.0 Promotion Library]]
+
| [[Fetch Profile Contest History]]
 +
| GET
 +
| /v1/{apikey}/profile/{profileId}.{webkey}/contest/history
 +
-->

Current revision

New to HelloWorld Web Services? Read this first: Getting Started


HelloWorld Web Services API uses a REST architecture for communication between your client and the HelloWorld 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 HelloWorld 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.

It is important to note that all communication to and from the HelloWorld Web Services API uses UTF-8 encoding.

It is important to note that the HTTP verb OPTIONS for CORS is not currently supported by default. Please reach out to your HelloWorld contact if you require this functionality

HelloWorld Web Services API

API Debugging

Output communication test GET /v1/{apikey}/test/communication
Input communication test POST /v1/{apikey}/test/communication
Input URL communication test PUT /v1/{apikey}/test/communication/{value}
Error response test PUT /v1/{apikey}/test/communication

Profiles

Create profile POST /v1/{apikey}/profiles
Fetch profile by key GET /v1/{apikey}/profile({key})/{value}
Fetch profile GET /v1/{apikey}/profile/{uid}

CAPTCHA

Create CAPTCHA challenge POST /v1/{apikey}/captcha
Fetch CAPTCHA challenge GET /v1/{apikey}/captcha/{challenge-id}
Validating_CAPTCHA_challenge_secret

Games and Awards

Award sweepstakes entry POST /v1/{apikey}/game/{gameid}/sweeps
Award instant win token POST /v1/{apikey}/game/{gameid}/tokens
Fetch token GET /v1/{apikey}/game/{gameid}/token/{tokenid}
Redeem token POST /v1/{apikey}/game/{gameid}/token/{tokenid}
Fetch prize GET /v1/{apikey}/game/{gameid}/prize/{prizeid}

Mail

Send email POST /v1/{apikey}/email/{template-id}

Code Services

Validate and consume code POST /v1/{apikey}/code/{codeClass}/{code}

Contest

Photo Upload Key POST /v1/{apikey}/contest/photo_upload_key
Enter Contest POST /v1/{apikey}/contest/entry
Fetch a Contest Entry GET /v1/{apikey}/contest/entry/{entryId}
Get All Contest Entries for a Profile GET /v1/{apikey}/profile/{profileId}.{webkey}/contest/entry
Rate a Contest Entry POST /v1/{apikey}/contest/entry/{entryId}/rate
Tattle on a Contest Entry POST /v1/{apikey}/contest/entry/{entryId}/tattle
Vote on a Contest Entry POST /v1/{apikey}/contest/entry/{entryId}/vote
Send a Contest Entry Link POST /v1/{apikey}/contest/entry/{entryId}/send_a_link
Browse Contest Gallery GET /v1/{apikey}/contest/gallery
Fetch Contest Leaderboard GET /v1/{apikey}/contest/most-popular


Personal tools