Updated on 2024-12-30 GMT+08:00

Obtaining a CAPTCHA Code

Function

This API is used to obtain a CAPTCHA code.

URI

GET /api/v2/sdk/captcha

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-operating-sys-version

Yes

String

Caller OS version, for example, Android 10.

X-device-fingerprint

Yes

String

Caller device fingerprint, for example, 156aysdna213sc50.

X-device-ip

No

String

Caller IP address, for example, 10.10.10.1

X-agent

Yes

String

User agent information, for example, Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36

X-L

No

String

Language type, for example, en.

X-client-id

Yes

String

Application ID, which is a ClientId allocated to an application after registration.

X-tenant-id

No

String

Tenant ID. This parameter is mandatory when calling an ISV application. Replace "{domain_name}" with the ISV common domain name "{common_domain}". In the request header, specify tenant_id of the corresponding tenant and replace X-client-id with client_id of the ISV application template.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

captchaId

String

Verification code ID.

projectCode

String

Project code, which is not supported currently. Returned value is fixed at null.

captchaOriginalPath

String

Verification code original path, which is not supported currently. Returned value is fixed at null.

captchaFontType

String

Verification code font, which is not supported currently. Returned value is fixed at null.

captchaFontSize

String

Verification code font size, which is not supported currently. Returned value is fixed at null.

secretKey

String

Secret, which is not supported currently. Returned value is fixed at null.

originalImageBase64

String

Native image encoded using Base64.

point

String

Slider coordinates for tapping to select.

jigsawImageBase64

String

Slider image encoded using Base64.

wordList

String

Text CAPTCHAs.

pointList

String

Coordinate CAPTCHAs.

pointJson

String

Point coordinates (Base64-encoded for transmission).

token

String

Unique ID of each verification code request.

result

String

Verification result.

captchaVerification

String

Secondary verification parameter in the background.

Status code: 400

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error details.

Example Requests

Obtain a CAPTCHA code.

GET https://{domain_name}/api/v2/sdk/captcha

X-operating-sys-version: Android 10
X-device-fingerprint: 156aysdna213sac
X-device-ip: 10.10.10.1
X-agent: Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36
X-L: zh
X-client-id: DRrYIqauawN0I8myTMoDTPys6ezGZxnm
X-tenant-id: 08f770f51f80d2f40f38c00cb199fd21

Example Responses

Status code: 200

Request successful.

{
  "captchaId" : null,
  "projectCode" : null,
  "captchaOriginalPath" : null,
  "captchaFontType" : null,
  "captchaFontSize" : null,
  "secretKey" : "yMX******hmq",
  "originalImageBase64" : "iVBORw0KGgoAAAANSUhEUgAAATYABj/WRVk78AAAAASUVORK5CYII=",
  "point" : null,
  "jigsawImageBase64" : "iVBORw0KGgoAAAANSUhEUgADcAAAAASUVORK5CYII=",
  "wordList" : null,
  "pointList" : null,
  "pointJson" : null,
  "token" : "389******fd1",
  "result" : false,
  "captchaVerification" : null
}

Status Codes

Status Code

Description

200

Request successful.

400

Invalid parameter.

Error Codes

See Error Codes.