Beta Captcha Tasks API
POSThttps://api.acedata.cloud/captcha/tasks
非同期の確認コードタスクの処理状況と最終結果を照会します。処理中および最終状態が失敗の場合、解決費用は発生しません。
リクエストヘッダー
acceptstring
Specifies the format of the response from the server.
選択してください
authorizationstring
Bearer token
リクエストボディ
task_idstring必須パラメータ
The task id returned when a token API was called with async=true.
レスポンス
成功200
OK, the request is successful.
レスポンスボディ
textstring
The recognized text for recognition/image2text. Present only when status is 'ready'.
typestring
任务类型。
tokenstring
The solved verification token (token APIs). Present only when status is 'ready'.
api_idstring
该任务所属接口的 ID。
statusstring
Persisted task state. 'processing' means the server is still working; 'ready' means the result is stored. Reading processing state has no lifecycle or billing side effects.
elapsednumber
Processing time in seconds (float, 3 decimals). Absent while the task is still processing.
successboolean
Whether the query succeeded.
task_idstring
The task id being polled.
user_idstring
发起该任务的账号 ID。
solutionobject
The recognition result for recognition/recaptcha2 and recognition/hcaptcha. Present only when status is 'ready'.
object <string, unknown>
trace_idstring
本次请求的追踪 ID,排查问题时提供给技术支持。
started_atnumber
When the task began processing, as a Unix timestamp in seconds (float).
finished_atnumber
When the task produced its result, as a Unix timestamp in seconds (float). Absent while the task is still processing.
actor_user_idstring
实际执行者的账号 ID。通过授权代发时与 `user_id` 不同。
credential_idstring
发起该任务所用凭证的 ID。
application_idstring
该任务计费所用应用的 ID。
authorization_idstring
该任务使用的授权 ID。未通过授权发起时为 null。
例
{
"token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1Ni......",
"status": "ready",
"success": true,
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002"
}失敗400invalid_query
Bad request, possibly due to a missing task_id.
レスポンスボディ
object <string, unknown>
例
{
"error": {
"code": "invalid_query",
"message": "no task_id specified"
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401invalid_token
Unauthorized, invalid or missing authorization token.
レスポンスボディ
object <string, unknown>
例
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗404not_found
The specified task_id does not exist.
レスポンスボディ
object <string, unknown>
例
{
"error": {
"code": "not_found",
"message": "task not found"
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗504timeout
The server-managed task reached its 120-second deadline without a result. Repeated reads return the same timeout, and the task is not charged.
レスポンスボディ
codestring
The terminal task timeout code.
detailstring
A stable description of the terminal task failure.
statusstring
elapsednumber
Processing time before the terminal failure, in seconds.
successboolean
task_idstring
The task id that reached a terminal failure.
started_atnumber
When the task began processing, as a Unix timestamp in seconds.
finished_atnumber
When the task reached its terminal failure, as a Unix timestamp in seconds.
例
{
"code": "timeout",
"detail": "The captcha task timed out.",
"status": "failed",
"elapsed": 112.4,
"success": false,
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"started_at": 1784885653,
"finished_at": 1784885765.4
}
Integration workbench
Shell
Python
JavaScript
Java
Go
PHP
注意:ストリーミングリクエストの場合、上記のコードは完全には適用されない可能性があります。変更のために統合ドキュメントを参照してください。
hCaptcha 認証コード認識サービス
一般残高の使用を許可
「一般残高を許可」を有効にすると、専用残高が不足した場合、自動的に一般残高が使用されます。