Skip to main content

createTask : creating a task

Description

This method creates a task for solving selected captcha type. In the parameters you need to pass the client authorization data, typed task data and other optional parameters.

Method address

<https://api.capmonster.cloud/createTask>

Request format: JSON POST


Request parameters

clientKey

Type: String
Required: Yes
Your unique account key, API key (You can find it here)

task

Type: Task object
Required: Yes
Task data array. See list of available object descriptions here.

callbackUrl

Type: String
Required: No
Web address for sending the captcha task result. Data is sent by POST request.
The content is identical to the response of the getTaskResult method.
The content of the response is not checked and you should accept the request in 2 seconds then the connection will be closed.


Request examples

Solving normal captcha with an image
    {
"clientKey":"67b6bcbb1a728ea8d563de6d169a2057",
"task":
{
"type":"ImageToTextTask",
"body":"BASE64_BODY_HERE!"
}
}
Solving ReCaptcha2
    {
"clientKey":"67b6bcbb1a728ea8d563de6d169a2057",
"task":
{
"type":"NoCaptchaTaskProxyless",
"websiteURL":"https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
"websiteKey":"6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd"
}
}

Response structure

errorId

Type: Integer
Required: Yes
Error identificator.
0 - no errors, the task has been successfully created, task ID located in taskId property
1 - error, information about it is in the errorCode property

errorCode

Type: String
Required: No
Error code. Check out error list.

taskId

Type: Integer
Required: Yes
Task ID for further use in getTaskResult method.


Response example

Response WITHOUT any error
    {
"errorId": 0,
"taskId": 7654321
}
Response WITH an error
    {
"errorId": 1,
"errorCode": "ERROR_KEY_DOES_NOT_EXIST",
"errorDescription": "Account authorization key not found in the system or has incorrect format",
"taskId": 0
}