Sub Users

These are 'sub accounts' that you can later give access to your hosting packages, every user is completely separate to your account and will only have access to hosting accounts that you assign.

get
List

https://hyper.host/api/v1/sub_users
List all customers.
Request
Response
Path Parameters
optional
string
200: OK

Example Requests

PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://hyper.host/api/v1/sub_users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: Bearer {token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
} ?>

post
Store

https://hyper.host/api/v1/sub_users
Request
Response
Form Data Parameters
name
required
string
Jack Reacher
email
required
string
jack@reacher.com
200: OK
Cake successfully retrieved.
{
"name": "Cake's name",
"recipe": "Cake's recipe name",
"cake": "Binary cake"
}
404: Not Found
Could not find a cake matching this query.
{
"message": "Ain't no cake like that."
}
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://hyper.host/api/v1/sub_users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('name' => 'John Doe','email' => 'email@newuser.com'),
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: Bearer {token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
} ?>

get
List Packages

https://hyper.host/api/v1/sub_users/:sub_user_id/packages
Get all the hosting packages that belong to a specific user.
Request
Response
Path Parameters
sub_user_id
required
string
Provided at https://hyper.host/sub_users
200: OK

Example Requests

PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://hyper.host/api/v1/suser/{{hyper_host_id}}/package",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: Bearer {token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
} ?>

delete
Delete

https://hyper.host/api/v1/sub_users/:sub_user_id
Delete a sub user.
Request
Response
Query Parameters
sub_user_id
required
string
Provided at https://hyper.host/sub_users
200: OK