说明 |
---|
通过 createTask方法 创建识别任务,然后通过 getTaskResult 方法 获取识别结果 |
创建任务
通过 createTask方法 创建识别任务
...
Use the |
Create Task
Create a recognition task using the createTask method.
Request Nodes:
...
Request URL:
请求地址: https://api.yescaptcha.com/createTask
请求格式:Request Format:
POST application/json
...
Object Structure:
Property |
---|
Type |
---|
Required |
---|
Description | |
---|---|
type | string |
True | TurnstileTaskProxyless
|
TurnstileTaskProxylessM1
|
| ||
websiteURL | string |
是
True | Web Address: Generally a fixed value. |
websiteKey | String |
是
网站密钥,一般固定值。
...
True | Site Key: Generally a fixed value. |
Request Example
代码块 | ||
---|---|---|
| ||
{ "clientKey":"cc9c18d3e263515c2c072b36a7125eecc078618f", "task": { "type":"TurnstileTaskProxyless", "websiteURL":"https://react-turnstile.vercel.app", "websiteKey":"1x00000000000000000000AA" } } |
...
Response Example
代码块 |
---|
{ "errorId": 0, "errorCode": "", "errorDescription": "", "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // 请记录此ID Please record this ID. } |
...
Get Result
使用 getTaskResult 方法获取识别结果
请求节点:
状态 | ||||
---|---|---|---|---|
|
getTaskResult
method to obtain the recognition result.Request Nodes:
...
Request URL:
请求地址: https://api.yescaptcha.com/getTaskResult
请求格式:Request Format:POST application/json
根据系统负载,您将在 10s 到 80s 的时间间隔内得到结果
...
Depending on the system load, you will receive the result within a time interval of 10 to 80 seconds.
Request Example
代码块 |
---|
{ "clientKey":"cc9c18d3e263515c2c072b36a7125eecc078618f3", "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" } |
...
Response Result
Property |
---|
Type |
---|
Description | |
---|---|
errorId | Integer |
Error Message:0 - |
No error,1 - Error occurred. | |
errorCode | string |
Error Code | |
errorDescription | string |
Error Detailed Description | ||
status | String | processing - |
Recognition in progress, please try again in 3 seconds. |
Recognition completed, find the result in the solution parameter. | |
solution | Object |
Identification results, different types of task results will be different. | |
gRecaptchaResponse | string |
识别结果:response值。
一次性使用,有效期120s,建议在60s内使用。
...
Identification result: response value. One-time use, valid for 120 seconds, recommended to use within 60 seconds. |
Request Example
代码块 | ||
---|---|---|
| ||
{ "errorId": 0, "errorCode": null, "errorDescription": null, "solution": { "token": "0.ufq5RgSVZd11DPSX1brdrxnEs28KcVlKj2ORchqxSy2q9yAW6ciq3hriXDF4x……", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", }, "status": "ready" } |
响应说明
...
识别成功:当errorId
等于0
并且status
等于 ready
,结果在solution
里面。
...
正在识别中:当errorId
等于0
并且status
等于 processing
,请3秒后重试。
...
Response Description
Successful identification: When errorId is equal to 0 and status is equal to ready, the result is in solution.
Identifying: When errorId is equal to 0 and status is equal to processing, please try again after 3 seconds.
Error: When errorId is greater than 0, please understand the error information according to errorDescription All error descriptions