Create CAPTCHA challenge

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(New page: <pre>Request representation: empty Response: 201 Created Location: /v1/{apikey}/captcha/{challenge-id} Response if CAPTCHA can not be created: 503 Service Unavailable </pre>)
Current revision (13:56, 30 June 2011) (edit) (undo)
 
(4 intermediate revisions not shown.)
Line 1: Line 1:
-
<pre>Request representation: empty
+
{{RESTfulAPI
 +
|crumbs=[[API Home Page]] :: [[CAPTCHA]]
 +
|summary=Create a CATPCHA challenge for the user to complete. Some [[API Key|API keys]] will require a CAPTCHA challenge to be solved before a profile can be created. The created CATPCHA challenge (which is binary image data which embeds the secret) must be [[Fetch_CAPTCHA_challenge|fetched]] and displayed to the user, and then the user's answer provided during [[Create_profile|profile creation]].
 +
|resource=/v1/{apikey}/captcha
 +
|methods=POST
 +
|resourceargs='''apikey''': Your [[API Key]]
 +
|paramsrequired=None.
-
Response:
+
Note: some users have had difficulty with empty POST requests. Adding a random name/value pair (foo=foo) to the request representation can avoid this problem.
-
201 Created
+
}}
-
Location: /v1/{apikey}/captcha/{challenge-id}
+
-
Response if CAPTCHA can not be created:
+
{{RESTfulExample
-
503 Service Unavailable
+
|title=Create a CAPTCHA Challenge
-
</pre>
+
|request=Request representation: empty
 +
|responsecode=201 Created
 +
|responseloc=Location: /v1/{apikey}/captcha/{challenge-id}
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result>1</result>
 +
}}
 +
 
 +
{{RESTfulExample
 +
|title=Response if CAPTCHA can not be created
 +
|request=Request representation: empty
 +
|responsecode=503 Service Unavailable
 +
|response=<?xml version="1.0" encoding="UTF-8" ?>
 +
<result />
 +
}}

Current revision

API Home Page :: CAPTCHA

Summary

Create a CATPCHA challenge for the user to complete. Some API keys will require a CAPTCHA challenge to be solved before a profile can be created. The created CATPCHA challenge (which is binary image data which embeds the secret) must be fetched and displayed to the user, and then the user's answer provided during profile creation.

Resource

/v1/{apikey}/captcha

Valid Methods

POST

Resource Arguments

Note: resource arguments are always required.

apikey: Your API Key

Parameters Required

None.

Note: some users have had difficulty with empty POST requests. Adding a random name/value pair (foo=foo) to the request representation can avoid this problem.



Example: Create a CAPTCHA Challenge

Request

Request representation: empty

Response

HTTP Status Code: 201 Created

HTTP Redirect Location: Location: /v1/{apikey}/captcha/{challenge-id}

<?xml version="1.0" encoding="UTF-8" ?>
<result>1</result>


Example: Response if CAPTCHA can not be created

Request

Request representation: empty

Response

HTTP Status Code: 503 Service Unavailable


<?xml version="1.0" encoding="UTF-8" ?>
<result />


Personal tools