Skip to content

i-kostiuk/time4vps-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

time4vps sdk

I have implemented 45% of the methods from the documentation at https://billing.time4vps.com/userapi. I plan to implement all the available functions in the near future. Please support me with your interest if you find this package useful.

Install:

composer require i-kostiuk/time4vps-api

  • laravel:
use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
  • php:
use Time4Vps\Time4Vps;

require __DIR__ . "/vendor/autoload.php";

$client = new Time4Vps($username, $password);

Available methods:

User Details

Return registration details for my account

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$details = $client->getDetails();

Update User Details

Update registration details under my account

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$details = $client->setDetails([
        "type" => "typeValue",
        "companyname" => "companynameValue",
        "companyregistrationnumber" => "companyregistrationnumberValue",
        "vateu" => "vateuValue",
        "email" => "emailValue",
        "firstname" => "firstnameValue",
        "lastname" => "lastnameValue",
        "country" => "countryValue",
        "address1" => "address1Value",
        "city" => "cityValue",
        "state" => "stateValue",
        "postcode" => "postcodeValue",
        "phonenumber" => "phonenumberValue",
        "emarketing" => "emarketingValue"
    ]);

List contacts

Return a list of contacts on this account

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$contacts = $client->getContacts();

Get contacts details

Return array with contact details

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$contact = $client->getContactDetails($contact_id);

List all portal notifications

Return a list of all portal notifications.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$notifications = $client->getNotifications();

List new portal notifications

Return only new portal notifications.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$notifications = $client->getNotificationsNew();

Acknowledge notification

Marks the notification as read

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$notification = $client->markNotificationsAsRead($notification_id);

Account balance

Get current account balance(unpaid invoices total), account credit

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$balance = $client->getBalance();

List Invoices

List all invoices under my account

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$invoices = $client->getInvoices();

Invoice Details

Get invoice details

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$invoice = $client->getInvoice($invoice_id);

Payment Methods

List available payment methods

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$payments = $client->getPayments();

Payment Methods Fees

List available payment methods with fees

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$payments = $client->getPaymentsFees();

List services

List all services under your account

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$services = $client->getServices();

Service label

Show current service label

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$service_label = $client->getServiceLabel($service_id);

Change service label

Set new custom label to identify this service

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$response = $client->setServiceLabel($service_id, $new_label);

List product categories

Return a list of product categories.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$categories = $client->getProductCategories();

List products in category

Return a list of product available for purchase under requested category

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$products = $client->getProductsInCategory($category_id);

Get product configuration details

Return product details with form configuration, addons and subproducts if available.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$product = $client->getProductDetails($product_id);

Get available VPS products

List all available virtual private server products

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$vps_products = $client->getAvailableVps();

List DNS

Returns a list of all DNS

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$dns = $client->getDns();

Get DNS details

Returns details of the DNS zone

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$dns = $client->getDnsDetails($service_id, $zone_id);

List SSL Certificates

List all ssl services under your account

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$certificates = $client->getCertificates();

List All Servers

Lists all active servers. Results includes only the brief information about the server. Call is synchronous - result returned immediately.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$servers = $client->getServers();

Server Details

Particular server details: configuration, installed OS, resource usage and etc. Call is synchronous - result returned immediately.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$server = $client->getServerDetails($server_id);

Available OS List

List of available OS templates for a server. Call is synchronous - result returned immediately.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$server_os = $client->getServerAvailableOsList($server_id);

Get additional IPs

List of additional IPs. Call is synchronous - result returned immediately.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$server_ips = $client->getServerAdditionalIps($server_id);

Get Usage History

Displays the bandwidth usage of a server. Call is synchronous - result returned immediately.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$history = $client->getServerUsageHistory($server_id);

Get available init scripts

Script content is not included

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$scripts = $client->getScripts();

Get init script by ID

Script content is included

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$script = $client->getScript($script_id);

List VPN Servers

Returns all available (including servers in maintenance) VPN servers.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$vpn_servers = $client->getVpnServers();

List VPN Clients

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$vpn_clients = $client->getVpnClients();

VPN login details

Returns oldest VPN plan login details, such as username, password, pre-shared key.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$vpn_login_details = $client->getVpnLoginDetails();

Get Usage History

Displays the bandwidth usage of a VPN service.

use Time4Vps\Time4Vps;

$client = new Time4Vps($username, $password);
$vpn_usage_history = $client->getVpnUsageHistory($id);