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

Description

This function retrieves information about the groups and applications in the authenticated user's cPanel interface.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Branding/get_available_applications

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 group and application information from the user's cPanel interface.
$app_info = $cpanel->uapi(
    'Branding', 'get_available_applications'
);

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 group and application information from the user's cPanel interface.
my $app_info = $cpliveapi->uapi(
    'Branding', 'get_available_applications'
);

Note:

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

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

Note:

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

 Command Line
uapi --user=username Branding get_available_applications

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":{
      "index":{
         "web_host_manager":[
            7,
            0
         ],
         "change_language":[
            8,
            1
         ],
         "addon_domains":[
            2,
            0
         ],
...
         "php_my_admin":[
            1,
            0
         ]
      },
      "grouporder":[
         "files",
         "databases",
         "domains",
         "email",
         "metrics",
         "security",
         "software",
         "advanced",
         "preferences",
         "pref"
      ],
      "groups":[
         {
            "group":"files",
            "desc":"Files",
            "items":[
               {
                  "width":"48",
                  "itemorder":"1",
                  "file":"file_manager",
                  "itemdesc":"File Manager",
                  "feature":"filemanager",
                  "subtype":"img",
                  "target":"file_manager",
                  "group":"files",
                  "acontent":"target=\"file_manager\"",
                  "searchtext":"File Manager file-manager",
                  "imgtype":"icon",
                  "base64_png_image":"",
                  "url":"filemanager/index.html",
                  "implements":"FileManager_Home",
                  "height":"48",
                  "onclick":"",
                  "type":"image"
               },
               {
                  "width":"48",
                  "itemorder":"2",
                  "file":"images",
                  "itemdesc":"Images",
                  "feature":"cpanelpro_images",
                  "subtype":"img",
                  "acontent":"",
                  "target":"",
                  "group":"files",
                  "searchtext":"image manager resize manager scaler thumbnailer format Images",
                  "imgtype":"icon",
                  "base64_png_image":"",
                  "url":"cpanelpro/images.html",
                  "module":"ImageManager",
                  "height":"48",
                  "onclick":"",
                  "type":"image"
               },
...
            ]
         },
         {
            "group":"domains",
            "desc":"Domains",
            "items":[
               {
                  "width":"48",
                  "itemorder":"1",
                  "file":"addon_domains",
                  "itemdesc":"Addon Domains",
                  "feature":"addondomains",
                  "subtype":"img",
                  "acontent":"",
                  "target":"",
                  "group":"domains",
                  "searchtext":"Domains Addon domain Addon Domains",
                  "imgtype":"icon",
                  "base64_png_image":"",
                  "url":"addon/index.html",
                  "implements":"Domains_AddonDomains",
                  "height":"48",
                  "onclick":"",
                  "type":"image"
               },
...
            ]
         },
...
      ],
      "implements":{
         "support":"WHMCS_support2",
         "Email_BoxTrapper":"boxtrapper",
         "Database_phpMyAdmin":"php_my_admin",
         "Email_Archive":"archive",
         "Stats_AWStats":"awstats",
         "FileManager_Home":"file_manager",
         "Email_AutoResponders":"autoresponders",
         "Site_Software":"site_software",
         "Email_Accounts":"accounts",
         "Cron_Home":"cron_jobs",
         "Locale_Change":"change_language",
         "Email_DefaultAddress":"default_address",
         "Password_Change":"change_password",
         "Email_MX":"mx_entry",
         "Domains_SubDomains":"subdomains",
         "Email_Authentication":"authentication",
         "Domains_AddonDomains":"addon_domains",
         "Email_Forwarders":"forwarders",
         "Email_AccountLevelFiltering":"global_email_filters",
         "Backups_Home":"backup",
         "Database_MySQL":"mysql_databases",
         "Email_DeliveryReport":"track_delivery",
         "ContactInfo_Change":"contact_information",
         "Email_SpamFilter":"apache_spam_assassin",
         "Calendar_Configure":"calendar_and_contacts",
         "Email_UserLevelFiltering":"email_filters",
         "Email_GreyListing":"greylisting",
         "Email_MailingLists":"mailing_lists"
      }
   }
}

Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample

nvarglist

or

arglist

string

The order in which to sort the groups.

If you do not supply a value, the function does not sort the groups.

A pipe-separated (|) list of group names.pref|software|domains

 

Returns

ReturnTypeDescriptionPossible valuesExample
index
              

 

hash of arraysA hash of arrays that contain the order in which applications appear in the cPanel interface.

This hash includes the app_name array.

 

app_name

array

An array that contains the order in which the application appears in the cPanel interface.

Note:

This parameter's name is the application's name.

The function returns this value in the index hash.

Two comma-separated non-negative integers.

  • The first integer represents the group in which the application appears.
  • The second integer represents the order in which the application appears in the group.
7,1
grouporderarrayAn array that contains the order in which the groups appear.A comma-separated list of group IDs.

"files","databases","domains","email","metrics","security","software","advanced","preferences","pref"

groupsarray of hashesAn array that contains information about the groups in the cPanel interface.

This array includes the group and desc returns and the items array.

 

group

string

The group's ID.

The function returns this value in the groups array.

A valid string.files

desc

string

The group's description.

The function returns this value in the groups array.

A valid string.Files

items

array of hashes

An array of hashes that contain group information.

The function returns this array in the groups array.

This array includes the width, itemorder, file, itemdesc, feature, subtype, target, group, acontent, searchtext, imgtype, base64_png_image, url, implements, height, onclick, feature, if, touch, and module returns. 

width

integer

The application's icon's width.

The function returns this value in the items array.

The application icon width, in pixels.

 

48

itemorder

integer

The application's order in the dynamicui.conf file.  

The function returns this value in the items array.

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

For example, the first item in the cPanel Home interface's itemorder value is 1.

4

file

string

The application's icon's filename.

The function returns this value in the items array.

An image's filename.

 

addon_domains

itemdesc

string

The application's display name.

The function returns this value in the items array.

A string value.Addon Domain

height

integer

The application icon height.

The function returns this value in the items array.

The application icon height, in pixels.

48

feature

string

A feature name. The icon only displays if the cPanel user can access this feature.

The function returns this value in the items array.

A feature name.addondomains

target

string

The target of the application's link.

The function returns this value in the items array.

A valid string.file_manager

acontent

string

The content of a tag in the application's link.

The function returns this value in the items array.

A valid string.

target=\"file_manager\"

base64_png_image

string

The application's icon in Base64 format.

The function returns this value in the items array.

A valid Base64-encoded image file. 

group

string

The item's group.

The function returns this value in the items array.

A string value.advanced

subtype

string

The item's subtype.

The function returns this value in the items array.

img is the only possible value.

img

imgtype

string

The item's image type.

The function returns this value in the items array.

icon is the only possible value.icon

searchtext

string

One or more search terms. The icon will display when users enter these search terms in the Quick Find text box in the cPanel interface.

The function returns this value in the items array.

A space-separated list of search terms.Domains Addon domain

url

string

The location to which the application's icon links.

The function returns this value in the items array.

A valid filepath or URL.

 

addon/index.html

type

string

The application's type.

The function returns this value in the items array.

image is the only possible value.

image

implements

string

The app_key that the function overwrote.

The function returns this value in the items array.

An application name.

WHM API 1's create_user_session and get_users_links functions use this value.

Domains_AddonDomains

onclick

string

A JavaScript function that the browser calls before or instead of URL navigation.

The function returns this value in the items array.

A valid string.

function

module

string

The Perl module that the application requires.

The function returns this value in the items array.

A valid string.My::Module

touch

string

Conditional arguments that determine whether to display the item, if a specified touch file exists.

The function returns this value in the items array.

A valid string.

ftp

if

string

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

The function returns this value in the items array.

A valid string that contains cPanel variables.

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

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

$is_reseller
implementshash

A hash that contains information about the applications and alternative names under which the cPanel interface displays them.

This hash includes the app_name return. 

app_name

string

The name of the application.

Note:

This return's name is the application's name.

The function returns this value in the implements hash.

A valid application name."Email_BoxTrapper":"boxtrapper",