Hive API v2

#42

Hi guys,

here you can find a Laravel package for interacting with Hive OS api

#43

Ругается… что ему не нравится ?

1.sh: 21: 1.sh: function: not found
1.sh: 30: 1.sh: [[: not found
1.sh: 30: 1.sh: 200: not found
1.sh: 1: 1.sh: jq: not found
1.sh: 35: 1.sh: Syntax error: “}” unexpected

#44

Hello,

I have created a mining monitoring program that performs scoring and statistics as well as profitability calculations. My program is under windows and is currently compatible with current currencies: ETH-ETC-ZEC
I would like to interact with my program so that it can give orders to hiveOS but I did not understand the use of hive very well
I understood that we must use the end point: https://api2.hiveos.farm/api/v2

to log in, use https://api2.hiveos.farm/api/v2/auth/login

When I enter this in a browser, I receive in response:
{
“message”: “”
}

How to authenticate on the API, the process seems complex!
I saw that there were several examples of programs in Javascript, PHP and bash.
I tried these different methods: javascript: impossible to execute the program (many errors)

Would it be possible to do the same thing as the bash but for BATCH WINDOWS ???

ooops if someone could guide me, it will be nice

Thank you for your reply
cordially

Jean Pierre

#45

I found the solution and I just implemented my gateway to the pc target hosting HIVEOS
by simply passing through CYGWIN and using the demo script in BASH (LINUX) on the HIVEOS forum
That way, I can run bash commands from WINDOWS

#46

Hi.
Correct me if I’m wrong.
After login, my token is valid for 2 weeks.
To acquire new token I need to provide 2FA code.
If above are true, I’m not able to automate token refresh, so I’m not able to fully automate my monitoring solution.
Is that right?

#47

Hi, you need to create personal API token for your monitoring system. This token never expires until you delete it.

#48

I’m trying to use the API to switch flight sheets, but I am having the following problem:

$ curl -s -w '\n%{http_code}' -H 'Content-Type: application/json' -H 'Authorization: Bearer KEY_DELETED' -X PATCH -d '{"fs_id": X16R}' https://api2.hiveos.farm/api/v2/farms/FARM_ID_DELETED/workers/WORKER_ID_DELETED
{
    "message": "Empty input"
}

I know the API key is OK, because this works:

curl -s -w '\n%{http_code}' -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkyLmhpdmVvcy5mYXJtIiwiaWF0IjoxNTU1MzgyMTA3LCJleHAiOjE4NzIyMTA5MDcsIm5iZiI6MTU1NTM4MjEwNywianRpIjo0OTA3MTg5LCJzdWIiOjQ5MDcxODksInJtYiI6dHJ1ZX0.0BqoOA_IaQlOvEmIAjLhgtDmZJcfq16Bg0szV1Ko76E' https://api2.hiveos.farm/api/v2/farms/37906/fs
{"data":[{"id":<REST OF RESPONSE DELETED>

Any help on what I am doing wrong in trying to change the flight sheet?

Thank you!

#49

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.

#50

Thank you, that fixed the problem!

#51

та же проблема , как то решили ?

#52

Добрый день. По таким вопросам обращайтесь в поддержку хайва (телеграм, почта), а это ветка по вопросам касательно API.

#53

yes, fine :slight_smile: