Skip to content
Last updated

Development Guides Home

Guide to Replacing cPanel API 1 Functions with UAPI Equivalents

This document lists the UAPI functions that replace previously-deprecated cPanel API 1 functions. As we developed additional UAPI functions, we created equivalents to some cPanel API 1 functions. These new modules and functions replace any cPanel API 1 functions without a current equivalent.

We are actively removing the cPanel API 1 functions. We strongly recommend that anyone using a cPanel API 1 function use a UAPI function instead.

Replace cPanel API 1 functions with UAPI equivalents

To retrieve a list of cPanel API 1 functions that custom integrations call your system, call the following WHM API 1 functions:

The following examples display code from a cPanel API 1 function and its UAPI equivalent. Click the tab below that corresponds to your chosen development language.

Note:

The examples below compare the cPanel API 1 SetLang::setlang function and the UAPI Locale::set_locale function.

LiveAPI PHP Class

cPanel API 1 function

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Set the "en" locale for the account.
$new_language = $cpanel->api1(
    'SetLang', 'setlang',
        array('en')
);

UAPI Function

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Set the "en" locale for the account.
$set_locale = $cpanel->uapi(
    'Locale', 'set_locale',
    array(
        'locale' => 'en',
    )
);

LiveAPI Perl Module

cPanel API 1 function

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Set the "en" locale for the account.
my $new_language = $cpliveapi->api1(
    'SetLang', 'setlang',
        ['en']
);

UAPI function

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Set the "en" locale for the account.
my $set_locale = $cpliveapi->uapi(
    'Locale', 'set_locale',
    {
        'locale' => 'en',
    }
);
Note:

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

For more information about how to replace a cPanel API 1 function with a UAPI function, read our Replace a cPanel API 1 Function With a UAPI Function documentation.

UAPI functions and legacy equivalents

The following tables list the UAPI functions that we added. The tables also list their cPanel API 1 equivalent functions.

For a complete list of UAPI functions and cPanel API 1 functions, read our Guide to UAPI and Guide to cPanel API 1 documentation.

BoxTrapper

ClamScanner

DenyIp

Fileman

Gpg

Htaccess

ImageManager

LogManager

MySQL®

Net

cPanel API 1 FunctionsUAPI Functions
Net::dnslookupDNS::lookup

Park

PHP

PostgreSQL®

ServerInformation

SetLang

Note:

We removed the SetLang cPanel API 1 module.

cPanel API 1 FunctionsUAPI Functions
SetLang::setlangLocale::set_locale
SetLang::listlangsoptLocale::list_locales

Stats

cPanel API 1 FunctionsUAPI Functions
  • Stats::analoglist
  • Stats::webalizer
  • Stats::webalizerftp
Stats::errlogStats::get_site_errors
Stats::showbandwidthStats::get_bandwidth

StatsManager

cPanel API 1 FunctionsUAPI Functions
StatManager::updateUserConfigStatsManager::save_configuration
StatManager::doFormStatsManager::get_configuration

SubDomain

cPanel API 1 FunctionsUAPI Functions
SubDomain::disablesubrdMime::delete_redirect
SubDomain::setsuburlMime::add_redirect
SubDomain::subdomainurlMime::get_redirect