Use our API for managing or reselling services from us or modify your account easily.
This is API documentation section, here you can learn how to remotely manage your account or services for an easy-to-use experience or to resell services from ThosHost to your customers
The current supported programming language is PHP, you can find our PHP class on GitHub for an easier integration.
<?php
// Include ThosHost API class.
require('thoshost_API_class.inc.php');
// Initiate the base for API calls
$API = new TH_API('API_USER', 'API_PASSWORD');
// Get account information
$accData = $API->getAccountInfo();
// Catch errors and retrieve the correct answer and status;
$accDetails = json_decode($accData, true);
if(isset($accDetails['status']) && $accDetails['status'] == 'OK')
{
// Print account details preserving whitespaces
$API->p($accDetails['answer']);
}
else if(isset($accDetails['status']) && $accDetails['status'] == 'cUrlError')
{
// If a cURL error is found, display it
echo 'cURL Error: '.$accDetails['answer'];
}
else if(isset($accDetails['status']) && $accDetails['status'] == 'FALSE')
{
// If an API problem is found, display the message
echo 'Error: '.$accDetails['answer'];
}
else
{
// If there is an invalid answer, display it
$API->p($accDetails['answer']);
}
?>
This API call / request will offer an answer like that:
Array
(
[user_id] => 1
[username] => ThosHost
[email] => support@thos-host.com
[account_money] => 0.00
[account_banned] => 0
[user_type] => admin
[country] => Romania
[state] => Bucharest
[city] => Bucharest
[address] => Default address
[real_name] => Unknown name
[phone_number] => 0000000000
[zip_code] => 000000
[company] => None
[last_online] => 2021-02-04 21:30:02
[newsletter_subscribed] => 0
[age] => 18
[creation_date] => 2021-01-30
[2fa] => 1
)
You can use the retrieved data from API answers for your systems.
ThosHost is a wonderful dedicated server provider that offer also web hosting solutions and domain names.
THOS-SOFTWARES LTD. (Reg: 13105427)
International House, 12 Constance Street, London, United Kingdom, E16 2DQ
© Copyright 2019 - 2022 ThosHost, all rights reserved.
All images, logos, icons, color palette, ThosGuy ("the man in a suit with logo head"), web design styles, marketing strategies or other specific aspects of ThosHost are THOS-SOFTWARES LTD. (Reg: 13105427) copyrights & intellectual properties, every unauthorized copy or reproduction of them is punished by law, the rest of resources are properties of their respective owners.