HTTP API


Getting the image

Your user should load the CAPTCHA image (PNG, 220x80) from the following URL:

GET http://raincaptcha.driversworld.us/api/v1/image/%USER_IDENTIFIER%

Where %USER_IDENTIFIER% is a unique string which identifies the user. We recommend you to use the user's IP address, combined with the domain name of your website.

Example: Displaying the image on a html page

If you want to display the CAPTHCA image on a web page, we recommend you to use an img tag:

<img src="http://raincaptcha.driversworld.us/api/v1/image/%USER_IDENTIFIER%" />

<img src="http://raincaptcha.driversworld.us/api/v1/image/example_org:127.0.0.1" />
<img src="http://raincaptcha.driversworld.us/api/v1/image/username@example.org" />

Checking the answer

If you need to check whether user's response is correct or not, load page from the following URL:

GET http://raincaptcha.driversworld.us/api/v1/check/%USER_IDENTIFIER%/%CAPTCHA_ANSWER%

Where %USER_IDENTIFIER% is a string which identifies the user and %CAPTCHA_ANSWER% is the submitted answer. If the submitted answer is correct, RainCaptcha will return true, otherwise it will return false.

NOTE: The CAPTCHA session is destroyed immediately after a page from this URL is requested.

Examples

GET http://raincaptcha.driversworld.us/api/v1/check/example_org:127.0.0.1/abcde
GET http://raincaptcha.driversworld.us/api/v1/check/username@example.org/fghij

Advertisement