Capmonster cloud help for api request

  • Автор темы Автор темы Vladimir99
  • Дата начала Дата начала

Vladimir99

Client
Регистрация
14.02.2019
Сообщения
34
Реакции
2
Баллы
8
Hello,

I try to create post request for capmonster cloud (getBalance just for start), but i have some problemes

I did post request url : https://api.capmonster.cloud/getBalance
Data : Content-Type:application/json
clientKey:myapikey

Result :
HTTP/1.1 403 Forbidden
Server: nginx/1.14.0 (Ubuntu)
Date: Mon, 15 Jun 2020 09:26:14 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 147
Connection: keep-alive


{"errorId":1,"errorCode":"ERROR_KEY_DOES_NOT_EXIST","errorDescription":"Account authorization key not found in the system or has incorrect format"}

If you can help me or send me template to use capmonster cloud api to resolve captcha it will be great

Regards
 
Could you please attach JSON part of your request.
There seems to be some wrong parameter.
 
ok i find issue, thank for your help
 
I want to post my problem but I can't :(
I had the same error u got but I can't solve it

this is my code
c#
-------------

capmonster captcha:
Развернуть Свернуть Копировать
        private static readonly string Token = "key";
        private static readonly CapMonsterClient client = new CapMonsterClient(Token);
        private  async Task RecaptchaAsync(string img)
        {
            string base64=GetBase64StringForImage(img);
            var captchaTask = new ImageToTextTask
            {
                Body= "data:image/jpeg;base64,"+base64,
                CapMonsterModule= "yandexnew"
            };
            int taskId;
            try
            {
                taskId = await client.CreateTaskAsync(captchaTask);
            }
            catch (CapMonsterException er)
            {
                Program.loger("RecaptchaAsync Erorr" + er.ErrorCode + "\r\n" + er.ErrorDescription);
                return;
            }
            try
            {
                var solution = await client.GetTaskResultAsync<ImageToTextTaskResult>(taskId);
                var solinput = FindElement("//html//body//div[2]//div[9]//div//div//div[1]//div//div[2]//div//div[1]//div[4]//div//div//div//div//div[2]//div//div//div[2]//input", new FindElementBy(), true);
                solinput.SendKeys(solution.Text);
                var sendbtn = FindElement("//html//body//div[2]//div[9]//div//div//div[1]//div//div[2]//div//div[1]//div[4]//div//div//div//div//div[3]//button", FindElementBy.XPath, true);
                sendbtn.Click();
            }
            catch (CapMonsterException er)
            {
                Program.loger("RecaptchaAsync Erorr" + er.ErrorCode + "\r\n" + er.ErrorDescription);
                return;
            }

        }
 
I want to post my problem but I can't :(
I had the same error u got but I can't solve it

this is my code
c#
-------------

capmonster captcha:
Развернуть Свернуть Копировать
        private static readonly string Token = "key";
        private static readonly CapMonsterClient client = new CapMonsterClient(Token);
        private  async Task RecaptchaAsync(string img)
        {
            string base64=GetBase64StringForImage(img);
            var captchaTask = new ImageToTextTask
            {
                Body= "data:image/jpeg;base64,"+base64,
                CapMonsterModule= "yandexnew"
            };
            int taskId;
            try
            {
                taskId = await client.CreateTaskAsync(captchaTask);
            }
            catch (CapMonsterException er)
            {
                Program.loger("RecaptchaAsync Erorr" + er.ErrorCode + "\r\n" + er.ErrorDescription);
                return;
            }
            try
            {
                var solution = await client.GetTaskResultAsync<ImageToTextTaskResult>(taskId);
                var solinput = FindElement("//html//body//div[2]//div[9]//div//div//div[1]//div//div[2]//div//div[1]//div[4]//div//div//div//div//div[2]//div//div//div[2]//input", new FindElementBy(), true);
                solinput.SendKeys(solution.Text);
                var sendbtn = FindElement("//html//body//div[2]//div[9]//div//div//div[1]//div//div[2]//div//div[1]//div[4]//div//div//div//div//div[3]//button", FindElementBy.XPath, true);
                sendbtn.Click();
            }
            catch (CapMonsterException er)
            {
                Program.loger("RecaptchaAsync Erorr" + er.ErrorCode + "\r\n" + er.ErrorDescription);
                return;
            }

        }
Don't see where you pass API-key for CM cloud in your code
 
Don't see where you pass API-key for CM cloud in your code

private static readonly string Token = "key";
private static readonly CapMonsterClient client = new CapMonsterClient(Token);

I thought by this I pass the key?
--------------------------------------
and I try to use postman to pass API and same issue happened
 
private static readonly string Token = "key";
private static readonly CapMonsterClient client = new CapMonsterClient(Token);

I thought by this I pass the key?
--------------------------------------
and I try to use postman to pass API and same issue happened
by this you declare, not pass
What is JSON result of you code?
Please attach it.
 
how I can pass the API then? can you tell me, please.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)