UAPI Functions - WebVhosts::list_domains

Description

This function lists virtual host names for each domain.

Examples


 cPanel or Webmail Session URL

https://hostname.example.com:2087/cpsess##########/execute/WebVhosts/list_domains

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List vhosts for each domain.
$list_vhosts $cpanel->uapi(
    'WebVhosts''list_domains'
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List vhosts for each domain.
my $list_vhosts $cpliveapi->uapi(
    'WebVhosts''list_domains',
);

 cPanel Template Toolkit

<!-- Retrieve login URI for the certificate provider. -->
[% execute('WebVhosts', 'list_domains', {} ) %]

 Command Line

uapi --user=username WebVhosts list_domains

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
      "transformed":1
   },
   "data": [
      
         "vhost_name":"hostname.example.com",
         "domain":"example.com",
         "vhost_is_ssl":1
      },
      {
         "vhost_name":"hostname.example2.com",
         "domain":"example2.com",
         "vhost_is_ssl":0
      }
   ]
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

This function does not accept parameters.

Returns

Return

Type

Description

Possible values

Example

vhost_name

string

The name of the virtual host.

A valid host's name on the account.

 hostname.example.com 

domain

string

The domain name.

 A valid domain name on the virtual host. 

example.com

 vhost_is_ssl 

 Boolean 

 Whether an SSL certificate secures the virtual host. 

  • 1 — Secured.
  • 0 — Not secured.

1

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....