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

Description

This function retrieves an application's information from a specific theme's sitemap.json file.

Examples  


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Branding/get_information_for_applications?docroot=%2Fusr%2Flocal%2Fcpanel%2Fbase%2Fwebmail%2Fpaper_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.
 
// Get the sitemap.json settings for Email Filters.
$app_info = $cpanel->uapi(
    'Branding', 'get_information_for_applications',
    array(
      'docroot'          => '/usr/local/cpanel/base/webmail/paper_lantern',
      'app_keys'         => 'email_filters'
    )
);

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.
 
# Get the dynamicui.conf settings for Email Filters.
my $app_info = $cpliveapi->uapi(
    'Branding', 'get_information_for_applications',
    {
      'docroot'          => '/usr/local/cpanel/base/webmail/paper_lantern',
      'app_keys'         => 'email_filters',
    }
);

Note:

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

 cPanel Template Toolkit
<!-- Get a hash of all the data, then display the itemdesc value. -->
[% data = execute( 'Branding', 'get_information_for_application', { 'app_keys' => 'email_filters' } ); %]
[% FOREACH q = data.itemdesc %]
     <p>
         [% q %]
     </p>
[% END %]
 

<!-- Get only the itemdesc value. -->
[% execute('Branding', 'get_information_for_applications', { 'docroot'          => '/usr/local/cpanel/base/webmail/paper_lantern', 'app_keys' => 'email_filters' } ).data.itemdesc %]

Note:

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

 Command Line
uapi --user=username Branding get_information_for_applications docroot=\/usr\/local\/cpanel\/base\/webmail\/paper_lantern app_keys=email_filters 

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": {
    
  },
  "data": {
    "email_filters": {
      "icon": {
        "width": 48,
        "url": "email_filters",
        "height": 48
      },
      "name": "Email Filters",
      "description": "Email Filters",
      "key": "email_filters",
      "order": 4,
      "url": "mail/filters/userfilters.html",
      "type": "item",
      "condition": {
        "feature": "blockers",
        "if": "!$is_archive_user"
      }
    }
  }
}

Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
docrootstring

Required

The path to the sitemap.json file within your theme's document root.

An absolute file path.
/usr/local/cpanel/base/webmail/paper_lantern
app_keysstring

The application's feature name.

If you do not specify this parameter, the output will include all of the applications that the sitemap.json file contains.

Any valid feature name.

Note:

This value must match an application's feature value in the sitemap.json file. For more information, read our Guide to cPanel Interface Customization - Appkeys documentation.

email_filters

Returns

ReturnTypeDescriptionPossible valuesExample

app_key

hash

A hash of information about the application that you specified in the app_keys parameter.

Note:

The function will return the app_keys parameter's value.

This hash includes the icon array of hashes, the name, description, key, order, url, and type returns, and the conditions array of hashes.

 

icon

array of hashes

A array of the application's icon information.

The function returns this array in the app_key hash.

An array of hashes that contains the details for the application's icon.

 

 

width

integer

The application's icon's width.

The function returns this value in the icon hash.

The application's icon's width, in pixels.

 

35

url

string

The location to which the application's icon links.

The function returns this value in the icon hash.

A valid filepath or URL.

 

email_filters

height

integer

The application's icon's height.

The function returns this value in the icon hash.

The application's icon's height, in pixels.

 

32

name

string

The application's name.

The function returns this value in the email_filters hash.

A string value.Email Filters

description

string

The application's display name.

 The function returns this value in the email_filters hash.

A string value.Email Filters

key

string

The application's feature name.

The function returns this value in the email_filters hash.

The app_key parameter's value.email_filters

order

integer

The application's order in the sitemap.json file.

The function returns this value in the email_filters hash.

A positive integer that represents the application's display order in cPanel's Home interface.

For example, the first item on the cPanel Home interface has an order value of 1.

4

url

string

The location of the application's file.

The function returns this value in the email_filters hash.

A valid filepath or URL.

 

mail/filters/userfilters.html

type

string

The application's type.

The function returns this value in the email_filters hash.

item is the only possible value. 

item

condition

array of hashes

An array of hashes of the condition of the application.

The function returns this value in the email_filters hash.

This hash includes the feature and if returns. 

feature

stringThe feature that the user must have access to in order to see the application in their cPanel Home interface.A valid string.blockers

if

string

Conditional arguments that determine whether to display the item, if any exist.

 

A valid string.

For example, $isreseller indicates that the item only displays for reseller accounts.

For more information, read our Guide to cPanel Variables documentation.

 

!$is_archive_user