createTask:task creating
WARNING
Creates a task for solving selected captcha type.
Specify which type of captchas in the parameter.
For example:ImageToTextTask
You can View all supported task types
Example request
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey":"YOUR_API_KEY",
"appId": "APP_ID",
"task": {
"type":"ImageToTextTask",// Write below the type you need to identify
"body":"BASE64 image"
}
}
Request Parameters
Parameters | Type | Required | Description |
---|---|---|---|
clientKey | String | Yes | Client account key, can be found in dashboard |
appId | String | No | Your Developer appId, Apply in dashboard’s developer section |
task | Object | Yes | Task object |
callbackUrl | String | No | token will send (post) to this endpoint |
Example response
Example of asynchronous task response
When a task is created as a token task or a special asynchronous task, the taskresult is obtained through the getTaskResult command
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"taskId": "37223a89-06ed-442c-a0b8-22067b79c5b4" // Save this ID for the next step
}
Example of Synchronous task response
If the task type is image recognition, voice recognition, or some special tasks, the task result is directly returned.
It can be judged by whether status
is equal to ready
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"status": "ready",
"solution": {
"text": "44795sds"
},
"taskId": "2376919c-1863-11ec-a012-94e6f7355a0b",
}
Response Structure
Parameters | Type | Description |
---|---|---|
errorId | Integer | Error message: 0 - no error 1 - with error |
errorCode | String | Error code table |
errorDescription | String | Error description |
status | String | returns the status, which can only be null or ready |
solution | Object | The synchronization task returns a result |
taskId | String | ID of the created task, Get Task results |