Description

This function lists SSL-related items on a domain.

Examples 


https://hostname.example.com:2083/cpsess##########/execute/SSL/list_ssl_items?domains=example.com%7Cexample1.com%7Cexample2.com&items=key%7Ccrt%7Ccsr

List keys:

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List SSL-related items on the example.com domain.
$SSL_list_ssl_items = $cpanel->uapi(
    'SSL', 'list_ssl_items',    array(
        'domains'          => 'example.com',
        'items'            => 'key',
 )
);

List CSRs:

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List SSL-related items on the example.com domain.
$SSL_list_ssl_items = $cpanel->uapi(
    'SSL', 'list_ssl_items',    array(
        'domains'          => 'example.com',
        'items'            => 'csr',
 )
);

List certificates:

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List SSL-related items on the example.com domain.
$SSL_list_ssl_items = $cpanel->uapi(
    'SSL', 'list_ssl_items',    array(
        'domains'          => 'example.com',
        'items'            => 'crt',
 )
);

List keys:

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List SSL-related items on the example.com domain.
my $SSL_list_ssl_items = $cpliveapi->uapi(
    'SSL', 'list_ssl_items',    {
        'domains'          => 'example.com',
        'items'            => 'key',
    }
);

List CSRs:

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List SSL-related items on the example.com domain.
my $SSL_list_ssl_items = $cpliveapi->uapi(
    'SSL', 'list_ssl_items',    {
        'domains'          => 'example.com',
        'items'            => 'csr',
    }
);

List certificates:

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List SSL-related items on the example.com domain.
my $SSL_list_ssl_items = $cpliveapi->uapi(
    'SSL', 'list_ssl_items',    {
        'domains'          => 'example.com',
        'items'            => 'crt',
    }
);

List keys:

<!-- List SSL-related items on the example.com domain. -->
[% data = execute( 'SSL', 'list_ssl_items', { domains => 'example.com', item => 'key'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

List CSRs:

<!-- List SSL-related items on the example.com domain. -->
[% data = execute( 'SSL', 'list_ssl_items', { domains => 'example.com', item => 'csr'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

List certificates:

<!-- List SSL-related items on the example.com domain. -->
[% data = execute( 'SSL', 'list_ssl_items', { domains => 'example.com', item => 'crt'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 

uapi --user=username SSL list_ssl_items domains=example.com%7Cexample1.com%7Cexample2.com items=key%7Ccrt%7Ccsr

List keys:

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "key",
      "host": "example.com"
    }
  ]
}

List CSRs:

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "csr",
      "host": "example.com"
    }
  ]
}

List certificates:

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "crt",
      "host": "example.com"
    }
  ]
}

Parameters

ParameterTypeDescriptionPossible valuesExample
domainsstring

The domain name or names.

A valid domain or pipe-separated list of domains.

To retrieve multiple domains, separate them with the pipe (|) character.

example.com
itemstring

The SSL item type or types.

This parameter defaults to key.

  • key
  • csr
  • crt

To retrieve multiple types, separate them with the pipe (|) character.

key

Returns

ReturnTypeDescriptionPossible valuesExample
idstringThe certificate's ID.A valid string.
example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff
typestringThe type of SSL item.
  • key
  • csr
  • crt
key
hoststringThe hostname.A valid hostname.example.com