Fetch promotions

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: <pre> Request representation: {profile-key}:{profile-value} {key1}:{value1}, {key2}:{value2}, ... {keyN}:{valueN} Response: 201 Created Location: /v1/{apikey}/profile/{uid} Entity body sa...)
Current revision (20:52, 4 March 2009) (edit) (undo)
 
(15 intermediate revisions not shown.)
Line 1: Line 1:
-
<pre>
+
{{RESTfulAPI
-
Request representation:
+
-
{profile-key}:{profile-value}
+
-
{key1}:{value1},
+
-
{key2}:{value2},
+
-
...
+
-
{keyN}:{valueN}
+
-
Response:
+
|summary=Fetch all the promotion resources, represented by API keys, available to the authenticated account.
-
201 Created
+
-
Location: /v1/{apikey}/profile/{uid}
+
-
Entity body same as GET /v1/{apikey}/profile/{uid}
+
-
Response if request invalid:
+
|example=Request representation: empty
-
400 Bad Request
+
-
Entity body describing failed validations
+
-
Response if profile with {profile-value} already exists:
+
Response:
-
405 Conflict
+
/v1/apikey1
-
</pre>
+
/v1/apikey2
-
 
+
...
-
Promotion is configured with one unique {profile-key} such as email, user_name, or mobile_phone. At a minimum, the profile must have a {profile-value} for this key and {profile-value} must be unique within the promotion.
+
-
Additional key:value pairs may be submitted. The {apikey} may enforce rules on these pairs such as required vs optional, size limits and validation. Common examples of other keys are address, birthdate and optin. The name of a key must begin with a letter and consist of only lowercase ASCII letters, numbers and underscores.
+
|detail=
 +
All available API keys registered to the account are returned. The account is determined by the hostname the request was made on, not the account name used in authentication (which may not be given for an untrusted request).
-
Typically the {apikey} will be configured to require a CAPTCHA challenge/response in the request headers. A failed CAPTCHA is the same as a failed validation, resulting in a response of 400 Bad Request.
+
|seealso=
-
This URL is an entry point. It may be easily attacked because valid URLs are easy to guess. CAPTCHA protects against automated attacks.
+
}}

Current revision

Summary

Fetch all the promotion resources, represented by API keys, available to the authenticated account.



Example

Request representation: empty

Response:
/v1/apikey1
/v1/apikey2
...

All available API keys registered to the account are returned. The account is determined by the hostname the request was made on, not the account name used in authentication (which may not be given for an untrusted request).

Personal tools