Refresh a Captcha
Refresh an existing captcha and return a new captcha for user verification.
Request URL
POST {base_url}/uc-auth/api/v1/public/captcha/refresh
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | The type of captcha to retrieve. Valid value:
|
| oldCaptchaId | No | String | The identifier of the existing captcha to refresh. Note:
|
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 refreshed 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 example
POST /uc-auth/api/v1/public/captcha/refresh?type=TEXT HTTP/1.1
Host: api.cn.novoone.com
Response example
HTTP/1.1 200 OK { "requestId": "d6647eab47cebc4a2f715d7297b743aa", "code": "200", "message": "success", "result": { "captchaId": "5b2c8fc735da4f488fb33f9c035bf5a3", "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.