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?

1 Like

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.