Hello,
You should send integer ID of the flight sheet in the request, but you send ‘{“fs_id”: X16R}’ which is also an invalid JSON.
Thank you, that fixed the problem!
та же проблема , как то решили ?
Добрый день. По таким вопросам обращайтесь в поддержку хайва (телеграм, почта), а это ветка по вопросам касательно API.
yes, fine
I have a problem that i can’t fix !
The API is working fine for me, i have my token , i can get all the params of the farm. That’s perfect !
But i can’t change a configuration by this API !
I looked at :
https://app.swaggerhub.com/apis/HiveOS/public/2.1-beta
… but i have in return a code 405 error (method not allowed).
Here is my PHP code. In this exemple i would like to change the config of the miner claymore.
$data = array();
$data['miners_config'][0]['miner'] = "claymore";
$data['miners_config'][0]['config']['claymore_user_config'] = "-di 0";
$url = "$infos_baseUrl/farms/$my-farm-id/workers/$my-rig-id";
// --> https://api2.hiveos.farm/api/v2/farms/######/workers/######
$headers = array();
$headers[] = "Content-Type: application/json";
$headers[] = "accept: application/json";
$headers[] = "Authorization: Bearer $infos_permanentToken";
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode($data),
]);
Is anyone can help ?
Thanks !
Hello, I’ve just tried your example and it works, returned status code is 200 which means the API is ok.
Strangly … you are right ! Not a 405 code anymore (i changed nothing ! it’s magic… ) but a 400 !
CODE : 400
Fatal error : Uncaught Exception: Empty input
Do you think it’s my $data sent wich is not correct ?
{
"miners_config": [
{
"miner": "claymore",
"config": {
"claymore_user_config": "-di 0"
}
}
]
}
It seems corrected formatted as in the exemple ?
Thanks for your help !
Your code in first message is absolutely correct - I launched it without any changes and it worked.
Something wrong on your side, maybe request body does not reach the server… Try some another POST and PATCH requests to check if they’re working.
Trying to use the “command” function in the API. I can authenticate and do other things in the API. I want to use the API to turn off the miner. Here is what I’m trying:
curl -s -w ‘\n%{http_code}’ -H ‘Content-Type: application/json’ -H ‘Authorization: Bearer API HASH DELETED’ -X POST -d ‘{“command”: “miner”, “data”: { “action”: “stop” } }’ http://api2.hiveos.farm/api/v2/farms/FARM ID DELETED/workers/WORKER ID DELETED
Here is what I get in response:
{
“message”: “”
}
405
I’m obviously doing something wrong in the JSON request, but I can’t figure it out, even after going through the API docs at https://app.swaggerhub.com/apis/HiveOS/public/2.1-beta#/
Any help is appreciated!
Hello,
You are using wrong endpoint, use this one:
/farms/{farmId}/workers/{workerId}/command
Thanks! I knew I was missing something obvious!
Is there an API to check for pool profitably?
api2.hiveos.farm/api/v2/wallets/{wallet_id}
The pool_balances are all 0 from hiveon pool. Proper for 2miners.
How do I get hiveon pool unpaid balance from the API?
Does anyone have an answer to this?
Getting unauthorized error when trying to access account data. This is since using the new api changes. Any word on when access will be allowed?
PHP example does not work… Does anyone have an example that does work?
Same here…
Same here, does not work.