We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - Branding::get_information_for_applications
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.

 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. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"messages": null,
	"data": {
		"email_filters": {
			"condition": {
				"if": "!$is_archive_user",
				"feature": "blockers"
			},
			"description": "Email Filters",
			"name": "Email Filters",
			"order": 4,
			"type": "item",
			"key": "email_filters",
			"url": "mail/filters/userfilters.html",
			"icon": {
				"height": 48,
				"url": "email_filters",
				"width": 48
			},
			"implements": "Email_UserLevelFiltering"
		}
	},
	"warnings": null,
	"status": 1,
	"errors": null,
	"metadata": {}
}
                    


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

hash

A hash of the application's icon information.

The function returns this in the app_key hash.

The hash contains the width, url, and height returns.



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 app_key hash.

A string value.Email Filters

description

string

The application's display name.

The function returns this value in the app_key hash.

A string value.Email Filters

key

string

The application's feature name.

The function returns this value in the app_key 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 app_key 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 app_key hash.

A valid filepath or URL.


mail/filters/userfilters.html

type

string

The application's type.

The function returns this value in the app_key hash.

item is the only possible value. 

item
   implementsstring

The module namespace for the specific application.

The function returns this value in the app_key hash.

Any valid string.

Email_UserLevelFiltering

condition

hash

A hash of the condition of the application.

The function returns this value in the app_key hash.

This hash includes the feature and if returns.

feature

string

The feature that the user must have access to in order to see the application in their cPanel Home interface.

The function returns this value in the condition hash.

A valid string. blockers

if

string

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

The function returns this value in the condition hash.


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