API REFERENCE GUIDE

utilities  challenge_new

api description

purpose

challenge_new generates CAPTCHA-like challenges. It returns an associative array composed of two elements:

  • token is a single-use token ID which is required to check the challenge value. This token is alive for one hour. After this delay, a new challenge must be generated.
  • img is a string which contains a base64-encoded picture.

See below an example of return data:

Checking a challenge value may done either with the generic API challenge_check as used in the test bed below, or in the context of some specific API such as subscribe or password_reset which require a challenge value and a token ID as parameters.

http method: POST

call cost: 1 point

See the pricing section for more details.

mandatory parameter(s)

parameter values / comments
api"challenge_new"
key E.g. "c54e7837e0cd0ced286cb5995327d1ab54e35987179b2". It is an application key generated by AuverCloud Studio.
heightPicture height (in pixels). The value must be between 5 and 200. The picture width is always 6 times the picture height.
methodThe challenge method to choose in the two following values:
  • "text" method: 6 characters to recognize. This is the default value when the parameter value is unknown.
  • "operation" method: Simple arithmetical operation with two operators e.g. 4 * 5 + 6.
colorText color: Either the keyword "random" or an hexadecimal 6-digits color e.g. "00aa00".

optional parameters(s)

None

call sample

This example is the code used in the test case below. It assumes that jQuery and the JavaScript AuverCloud runtime client are loaded in order to use the arc.api() method. See the API client section for more details.


							

errors

None.

See also the Common errors section.

test bed

Call

To test the API with your own keys, please see the section Application keys in AuverCloud Studio.

api
challenge_new
key
height
method
color
 send
request
 clear
response

See the API challenge_check to check the value that you can infer from the picture below.

Response
code
msg
data
picture

discussion