Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing argument in createTask method #26

Open
AnthonyLzq opened this issue Mar 26, 2022 · 2 comments
Open

Missing argument in createTask method #26

AnthonyLzq opened this issue Mar 26, 2022 · 2 comments

Comments

@AnthonyLzq
Copy link

I was checking the AntiCaptcha class, the method createTask has three params in the method signature, according to this:

/**
   * Dispatch a task creation to the service. This will return a taskId.
   *
   * @param {string} task - Task to perform
   * @param {string} websiteKey - The value of the "data-site-key" attribute. <- this param is missing
   * @param {string} languagePool - The language pool. Default to English if not provided.
   *
   * @memberof AntiCaptcha
   */
  public async createTask<T>(
    task: T,
    languagePool: LanguagePoolTypes = LanguagePoolTypes.ENGLISH
  ) {
    const response = (await this.api.post("createTask", {
      languagePool,
      task
    })) as ApiResponse<ICreateTaskResponse>;

    if (response.ok && response.data.errorId === 0) {
      return response.data.taskId;
    }
    throw new AntiCaptchaError(
      response.data.errorCode,
      response.data.errorDescription
    );
  }

Is the websiteKey not longer required?

@ScreamZ
Copy link
Owner

ScreamZ commented Mar 28, 2022

I guess it is, based on the two other things, might be nice to check if you use this endpoint.

Based on that, I guess it is : https://anti-captcha.com/apidoc/methods/createTask

@AnthonyLzq
Copy link
Author

I do, in fact createTaskRecaptchaV2Proxyless, createTaskRecaptchaV3Proxyless and createTask both uses the same endpoint, but only in the createTask method the declaration is wrong.

Repository owner deleted a comment from Arpitkandwal Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants