API login

I see the login requires a 2FA token, which is a bit hard (impossible?) to implement programmatically. I want to create a server which monitors my rigs by gathering stats every minute and then sending an email and text if there is an issue. I can’t be entering a 2FA code every minute - how is this supposed to work?

3 Likes

API Login issue - I strggle the same.

Ive user BASH API from Hive API v2
Basicllly it generates login curl like:

curl -s -w '\n%{http_code}' -H 'Content-Type: application/json' -X POST -d '{"login":"--login---","password":"---api-token---"}' https://api2.hiveos.farm/api/v2/auth/login

and it throws 403:

{
    "message": "Security code is required",
    "code": 403003
}
403

Since token is fresh, reobrained with entered 2FA … what else can I do on my side? Or what Im doing wrong? Thanks for help.

Ive assume that login = my user account login, and pass = generated api key.

Did you manage to solve it? I have the same problem in implementing in PHP class. The sample function is completely inoperable, returning the security code is required or blocks access to the login api for 30 minutes.

I just created an API token and it works fine. I’m using C#, not sure about PHP.

Could you upload your C# code? Might help us see where the problem is at. I tried php and js and I’m still getting the Security Code is required error

Hi , have you been able to solve the issue ‘security code is required’ as the response?

Кто то решил проблему с

{ “message”: “Security code is required”, “code”: 403003 }

???