Page tree
Skip to end of metadata
Go to start of metadata

Description

This function lists the account's available webmail clients.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/WebmailApps/list_webmail_apps?theme=paper_lantern

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Lists the webmail clients that are available for the account.
$list_webmail_apps = $cpanel->uapi(
    'WebmailApps', 'list_webmail_apps',
    array(
        'theme'  => 'paper_lantern',
          )
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Lists the webmail clients that are available for the account.
my $list_webmail_apps = $cpliveapi->uapi(
    'WebmailApps', 'list_webmail_apps',
    {
        'theme'    => 'paper_lantern',
    }
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Get a hash of webmail apps, then display the id only. -->
[% data = execute('WebmailApps', 'list_webmail_apps', { 'theme' => 'paper_lantern', } ) %]
[% FOREACH q = data.id %]
     <p>
         [% q %]
     </p>
[% END %]
     
<!-- Get only the id. -->
[% execute('WebmailApps', 'list_webmail_apps', { 'theme' => 'paper_lantern', } ).data.id %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username WebmailApps list_webmail_apps theme=paper_lantern

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "icon": "/webmail/paper_lantern/images/horde.gif",
      "url": "/cpsess##########/horde/index.php?cpanel=1",
      "displayname": "Horde",
      "id": "horde",
    },
    {
      "icon": "/webmail/paper_lantern/images/roundcube_logo.png",
      "url": "/cpsess##########/3rdparty/roundcube/index.php",
      "displayname": "Roundcube",
      "id": "roundcube",
    },
    {
      "icon": "/webmail/paper_lantern/images/squirrelmail_logo.gif",
      "url": "/cpsess##########/3rdparty/squirrelmail/index.php",
      "displayname": "SquirrelMail",
      "id": "sqmail",
    }
  ]
}

Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
themestring

The webmail theme.

This parameter defaults to the server's default theme.

A valid theme on the server.

paper_lantern

 

Returns

OutputTypeDescriptionPossible valuesExample
iconstringThe icon file.An icon file's path, relative to the /usr/local/cpanel/base/frontend directory.
/webmail/paper_lantern/images/roundcube_logo.png
urlstring

The webmail client's URL.

A valid string.

/cpsess##########/3rdparty/roundcube/index.php
displaynamestring

The webmail client name, as it will display in the interface.

A valid string.

Roundcube
idstringThe webmail client's ID.A valid string.
roundcube