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

add

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

    • key: Key authorized by Api administrator
    • action: add
    • user: User owners of the scheduled tasks
    • type: (domain or subdomain)
    • name: Domain Name or Subdomain Example: my.subdomain.com
    • path: Path where the domain or subdomain points, Example: public_html/my subdomain/
    • autossl: 1 or 0 [You can Generate an AutoSSL (The domain must be pointing to the Server)]

Possible answers:

    • status -> OK
    • status -> Error -> user does not exist

Example of code in php

$data = array(“key” => “MYKEY”,”action”=>’add’,  ”user”=>’USER’, ”type”=>’domain’, ”name”=>’MY_DOMAIN’, ”path”=>’MY_PATH’, ”autossl”=>’1’);
$url = “https://IPSERVERAPI:2304/v1/admindomains”;
$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 1 No 2