1. Home
  2. Docs
  3. Developer Guide
  4. API Manager
  5. Functions
  6. Packages
  7. add

add

Functionpackages
To make use of the ‘add‘ Action, the following parameters must be sent:

    • key: Key authorized by Api administrator
    • action: add
    • package_name: Package Name
    • disk_quota: MB disk space
    • bandwidth: Bandwidth
    • ftp_accounts: Number of FTP accounts
    • email_accounts: Number of e-mail accounts
    • email_lists: Number of email lists
    • databases: Number of Data Base Mysql/MariaDB
    • sub_domains: Number of Max Sub Domains
    • parked_domains: Number of Max Parked Domains
    • addons_domains: Number of Max Addons Domains
    • hourly_emails: Number of Max hourly emails
    • reseller: Park with a 1 for reseller type package, dial with the name of a reseller user for sub-packages of a reseller, leave empty for defect package
    • accounts: Maximum number of accounts for the reseller

Possible answers:

    • status -> OK
    • status -> Error, msj -> Package name missing
    • status -> Error, msj -> You must specify the disk size
    • status -> Error, msj -> Name already exists

Example of code in php

$data = array(“key” => “MYKEY”,”action”=>’add’,”package_name”=>’NAME_PACKAGE’, ”disk_quota”=>’’, ”bandwidth”=>’’, ”ftp_accounts”=>’’, ”email_accounts”=>’’, ”email_lists”=>’’, ”databases”=>’’, ”sub_domains”=>’’, ”parked_domains”=>’’, ”addons_domains”=>’’, ”hourly_emails”=>’’);
$url = “https://IPSERVERAPI:2304/v1/packages”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt ($ch, CURLOPT_POST, 1);
$response = curl_exec($ch);
curl_close($ch);
Was this article helpful to you? Yes No