Get a Captcha
Retrieve a captcha for user verification on the login page.
Request URL
GET {base_url}/uc-auth/api/v1/public/captcha
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | The type of captcha to retrieve. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| code | String | The HTTP status code of the request.
|
| message | String | The status message of the request. |
| detailMessage | String | The detailed error information. When the request is successful, this parameter returns empty. |
| result | Object<Captcha_Info> | The captcha information. |
- Captcha_Info
-
Parameter Type Description captchaId String The unique identifier of the captcha. captchaType String The type of captcha returned. TEXT: A text-based captcha.SLIDER: A slider-based captcha.
captchaImage String The Base64-encoded captcha image data. Note: Returned whentypeisTEXT.backgroundImage String The Base64-encoded background image of the slider puzzle. Note: Returned whentypeisSLIDER.sliderImage String The Base64-encoded slider piece image of the slider puzzle. Note: Returned whentypeisSLIDER.yposition Integer The vertical position of the slider piece on the background image. Note: Returned whentypeisSLIDER.
Example
Request exampleGET /uc-auth/api/v1/public/captcha?type=TEXT HTTP/1.1
Host: api.cn.novoone.com
Response example
HTTP/1.1 200 OK { "requestId": "0f3c614032847828adc089015d34ec70", "code": "200", "message": "success", "result": { "captchaId": "93e9f3ebd3b743d1a9706e86aacbc6a1", "captchaType": "TEXT", "captchaImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAoCAIAAAC6iKly..." } }
Note: The
captchaImage field contains a complete
Base64-encoded PNG image data (approximately 3,000 characters). The value shown above is
abbreviated.