Hello guys,
I’m trying to interact with the API in Python but I couldn’t authenticate. Is there anybody who got it working with python? Here is my code, now It’s just a scratch for getting auth and get farm data:
import requests
url =“https://api2.hiveos.farm/api/v2/auth/login”
headers = {
“login”: “myemail”,
“password”: “mylogin for hiveos”,
“twofa_code”: " Turned this off so I leave it blank",
“remember”: “true”,
“Authorization”:“Bearer”“my api token wich i generated in my hiveos settings”
}
response = requests.request(“GET”, url, headers=headers)
#json_data = response.json() Here i got code 405
url1 =“https://api2.hiveos.farm/api/v2/farms/3266808/stats”
response1 = requests.request(“GET”, url1,)
json_data1 = response1.json()
print(json_data1)here i got code 405
{‘message’: ‘Unauthenticated.’}
Thanks for the replys!