API error Fossbilling / Hestia

Hello all,

I am trying to set Fossbilling to Hestia via API but with no luck. I keep getting: HTTP/2 400 returned for “https://hosting.xxxxxx.com/api/”. (400) can someone help me out?
I set api keys, whitelisted, ect…

Hi @splinter,

You need to add the port used by the panel, by default it is 8083.

https://hosting.xxxxxx.com:8083/api/
1 Like

Hi sahsanu,

adding 8083 to the connection port gives following error: HTTP/2 401 returned for “https://hosting.xxxxxx.com:8083/api/”. (401)

401 error code means authorization failed so you are not using the right credentials. Did you create the access key for your user?

Yes I have

Take a look to this post to see whether you are using the right access and secret keys. If you are not using the admin user, check that you allow other users to use the api.

Yes it is enabled for my user (Enabled for all users during testing) keys are correct for this same user too

Then check the auth.log to see whether the access key is the right one and the client’s ip used is whitelisted.

/var/log/hestia/auth.log

All seems good, I don’t know why its not working

No errors in auth.log?

Apart the failed logins no, access key is good, my ip is whitelisted… I will need a walkthrough with an expert I think

Show the output of this command and tell me if the ip with failed logins is there:

v-list-sys-config json | jq -r '.config|to_entries[]|select(.key|startswith("API"))|[.key,.value]|join("=")'

Also, if you created an access key, show the content of the file with the name of access key located here (replace secret key with fake data):

/usr/local/hestia/data/access-keys/YourAcccessKeyFile

Also, show the output of this command:

ls -l /usr/local/hestia/web/api/index.php

API=yes
API_SYSTEM=2
API_ALLOWED_IP=20x.xxx.xx.xx,2xx.xxx.xxx.x
AccessKey
,127.0.0.1

-rw-r–r–

I confirm my server ip and local user ip is present

As I said, show the content of the file with the name of access key located here (replace secret key with fake data):

SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
USER='admin'
PERMISSIONS='mail-accounts,purge-nginx-cache,update-dns-records'
COMMENT='Fossbilling'
TIME='13:33:09'
DATE='2024-06-26'
EXPIRES_IN=''
IP=''

Not sure why ip is blank?

That should be billing and your user MUST have admin role.

PERMISSIONS='billing'

When we setup there are only these options, so I changed to ‘billing’ manually.
Like stated in docs, I created a user linked to domain. So I need to set admin as domain user and ingore the warning?

my Fossbilling user has admin privileges

Do I need to add ip address of server?

PERMISSIONS=‘billing’
COMMENT=‘Fossbilling’
TIME=‘13:33:09’
DATE=‘2024-06-26’
EXPIRES_IN=‘’
IP=‘???’

Ok.

No, the user must have an Administrator role, there is no need to use admin user.

Ok

No.

Ok it did connect it turned out to be the network interface tab in system settings…Needs the ip of server there and not the default ‘none php’, however when creating a user in Fossbilling it is not reflected in Hestia ??

I’ve never used Fossbilling so I don’t know how it works