UAPI Functions - Branding::get_information_for_applications

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

 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'
    )
);

 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',
    }
);

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

 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.

 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 (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

 Parameter 

 Type 

Description

Possible values

Example

docroot

string

Required

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

An absolute file path.

 /usr/local/cpanel/base/webmail/paper_lantern 

app_keys

string

The application's feature name.

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

Any valid feature name.

Note:

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

email_filters

 

Returns

Return

Type

Description

Possible values

Example

app_key

hash

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

Note:

The function will return the app_keysparameter'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_filtershash.

A string value.

Email Filters

 description 

string

The application's display name.

 The function returns this value in the email_filtershash.

A string value.

Email Filters

key

string

The application's feature name.

The function returns this value in the email_filtershash.

The app_key parameter's value.

email_filters

order

integer

The application's order in thesitemap.json file.

The function returns this value in the email_filtershash.

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 anorder value of 1.

4

url

string

The location of the application's file.

The function returns this value in the email_filtershash.

A valid filepath or URL.

 

 mail/filters/userfilters.html 

type

string

The application's type.

The function returns this value in the email_filtershash.

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

This hash includes the featureand if returns.

 

feature

string

The 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, $isresellerindicates that the item only displays for reseller accounts.

 

!$is_archive_user

 

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