UAPI Functions - SSL::list_ssl_items

Description

This function lists SSL-related items on a domain.

Examples 


 cPanel or Webmail Session URL

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

 LiveAPI PHP Class

List keys:

1
2
3
4
5
6
7
8
9
$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:

1
2
3
4
5
6
7
8
9
$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:

1
2
3
4
5
6
7
8
9
$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',
 )
);

 LiveAPI Perl Module

List keys:

1
2
3
4
5
6
7
8
9
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:

1
2
3
4
5
6
7
8
9
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:

1
2
3
4
5
6
7
8
9
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',
    }
);

 cPanel Template Toolkit

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 %]

 Command Line

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

 

Notes:

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

 Output (JSON)

List keys:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "key",
      "host": "example.com"
    }
  ]
}

List CSRs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "csr",
      "host": "example.com"
    }
  ]
}

List certificates:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "type": "crt",
      "host": "example.com"
    }
  ]
}

 

Note:

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

 

Parameters

 Parameter 

 Type 

Description

Possible values

Example

domains

string

The domain name or names.

A valid domain or pipe-separated list of domains.

Note:

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

 example.com 

item

string

The SSL item type or types.

 This parameter defaults tokey. 

  • key
  • csr
  • crt

Note:

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

key

 

Returns

 Return 

Type

Description

Possible values

Example

id

 string 

The certificate's ID.

A valid string.

 

type

string

 The type of SSL item. 

  • key
  • csr
  • crt

key

host

string

The hostname.

 A valid hostname. 

 example.com 

 

  • 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....