Authorization
Last modified by Hostkey Admin on 2023/04/21 12:15
In order to use API, you need to get an authorization token first.
This could be done via an API call to Auth URL: invapi.hostkey.com/auth.php
Auth actions:
Resource | Action | Description |
---|---|---|
auth.php | whmcslogin | Obtains a session token |
auth.php | logout | Removes a session token |
auth.php | info | Gets session token environment |
eq.php | set_pin | set/change PIN for the user |
eq.php | check_pin | validate entered PIN (optional) |
Auth/Whmcslogin
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | whmcslogin | Main action - Obtains an access token |
user | * | string | Your billing login | |
password | * | string | Your billing password | |
fix_ip | int | fix_ip=0 - do not bind token to address, fix_ip=1 - bind | ||
ttl | int | 10800 | Session lifetime in seconds, default 10800 (3 hours) |
curl -s "https://invapi.hostkey.com/auth.php" -X POST \
--data "action=whmcslogin" \
--data "user=" \
--data "password="
--data "action=whmcslogin" \
--data "user=" \
--data "password="
Auth/Logout
HTTP Method - POST/GET
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | logout | Main action - logout will remove auth token from the database. Please do not forget to log out to avoid possible security issues |
token | * | string | Token for expiration |
curl -s "https://invapi.hostkey.com/auth.php" -X POST \
--data "action=logout" \
--data "token="
--data "action=logout" \
--data "token="
Auth/Info
HTTP Method - POST/GET
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | info | Main action - info will return full data about your token including your server's identification numbers when you are logged in. |
token | * | string | Your API token |
curl -s "https://invapi.hostkey.com/auth.php" -X POST \
--data "action=info" \
--data "token="
--data "action=info" \
--data "token="
PIN-codes
We are trying to keep our customer's servers safe, even in case of data leaks on the user's devices. The system will ask for a PIN for every critical server's operation.
The PIN is a short password to keep equipment safe and should not be stored anywhere. We could only reset it via manual support request after extra security verification.
Eq/Set_pin
HTTP Method - POST/GET
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | set_pin | Main action - Set/Change PIN for the user |
token | * | string | Your API token | |
old_pin | for change | int | Old PIN code | |
new_pin | * | int | New PIN code |
curl -s "https://invapi.hostkey.com/eq.php" -X POST \
--data "action=set_pin" \
--data "token=" \
--data "old_pin=" \
--data "new_pin="
--data "action=set_pin" \
--data "token=" \
--data "old_pin=" \
--data "new_pin="
Eq/Check_pin
HTTP Method - POST/GET
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | check_pin | Main action - Validate entered PIN |
token | * | string | Your API token | |
pin | * | int | Your PIN code |
curl -s "https://invapi.hostkey.com/eq.php" -X POST \
--data "action=check_pin" \
--data "token=" \
--data "pin="
--data "action=check_pin" \
--data "token=" \
--data "pin="