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 - Variables::get_user_information
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the user's account configuration settings.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Variables/get_user_information?name-1=domain&name-2=cgi_enabled&name-3=dkim_enabled



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.
 
//Retrieve user settings for example.com.
$variables = $cpanel->uapi(
    'Variables', 'get_user_information',
    array(
        'name-1' => 'domain',
		'name-2' => 'cgi_enabled',
		'name-3' => 'dkim_enabled',
        )
);


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.
 
# Retrieve user settings for example.com.
my $variables = $cpliveapi->uapi(
    'Variables', 'get_user_information',
    {
        'name-1' => 'domain',
		'name-2' => 'cgi_enabled',
		'name-3' => 'dkim_enabled',
    }
);


Note:

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

 Command Line
uapi --user=username Variables get_user_information name-1=domain name-2=cgi_enabled name-3=dkim_enabled


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,
  "errors": null,
  "status": 1,
  "metadata": {
     
  },
    "data" : {
        "cgi_enabled" : "1",
		"dkim_enabled" : "1",
		"domain" : "example.com",
    },


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

The user configuration variables to retrieve.

Note:

Pass this parameter multiple times to retrieve multiple variables. For example, name-1=variable, name-2=variable, name-3=variable 

If you don't use this parameter, this function returns all of the user's configuration data. 

 Click to view...
  • backup_enabled
  • bandwidth_limit
  • cgi_enabled
  • contact_email
  • contact_email_2
  • cpanel_root_directory
  • created
  • dead_domains
  • demo_mode
  • disk_block_limit
  • dkim_enabled
  • domain
  • domains
  • feature_list 
  • gid
  • home
  • home_directory_links
  • ip
  • last_modified
  • legacy_backup
  • locale
  • mailbox_format
  • maximum_addon_domains
  • maximum_databases
  • maximum_defer_fail_percentage
  • maximum_email_account_disk_quota
  • maximum_emails_per_hour
  • maximum_ftp_accounts
  • maximum_mail_accounts
  • maximum_mailing_lists
  • maximum_parked_domains
  • maximum_subdomains
  • owner
  • plan
  • pushbullet_access_token
  • shell
  • spf_enabled
  • theme
  • user
  • utf8_mailbox
  • uid
  • user
domain 

Returns

ReturnTypeDescriptionPossible valuesExample

backup_enabled

 
BooleanWhether the user has backups enabled.
  • 1 — Backups enabled.
  • 0 — Backups not enabled.
1 
bandwidth_limitstring

The account's bandwidth limit.

  • unlimited
  • A maximum amount of bandwidth, in Megabytes (MB).
unlimited 
cgi_enabledBooleanWhether CGI is enabled.
  • 1 — Enabled.
  • 0 Not enabled.
1 
contact_emailstring

The account's contact email address.

A valid email address.user@example.com 
contact_email_2stringThe account's alternate contact email address, if one exists.A valid email address.user2@example.com 
cpanel_root_directory string

The cPanel root directory.

A valid directory path./usr/loca/cpanel 
created integerThe account's creation date.

The date in YY Mon DD HH:mm human-readable format, where:

  • YY represents the year.
  • Mon represents the month.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
13 May 22 16:03
dead_domainsarray of stringsThe account's inactive domains.An array of one or more domains or subdomains.example.example.com
demo_modeBooleanWhether demo mode is enabled.
  • 1 — Enabled.
  • 0 Not enabled.
1 
disk_block_limitintegerThe number of disk blocks for the account.A positive integer, in, kilobytes.100000000
dkim_enabled BooleanWhether DKIM is enabled.
  • 1 — Enabled.
  • 0 Not enabled.
1 
domainstring

The cPanel account's main domain.

A valid domain name.example.com
domainsarray of stringsA list of the account's domains and subdomains.An array of one or more valid domains or subdomains.example.com
feature_list stringThe cPanel account's feature list name.A valid feature list name.feature_list 
gid integerThe account's group ID.An integer value.5678 
home stringThe user's home directory.A valid file path./home/user 
home_directory_linksarray of stringsAny symlinks to the cPanel account's home directory.An array of one or more home directory symlinks.symlink
ipstring

The account's IPv4 address.

A valid IPv4 address.192.0.2.0
last_modified integer

The most recent modification time of the /var/cpanel/users/user file.

Note:

user represents the cPanel user.

A time, in Unix time format.1416586493
legacy_backup_enabledBoolean

Whether legacy backups are enabled.

  • 1 — Enabled.
  • 0 — Disabled.
1 
localestring

The account's default locale.

A two-letter ISO-3166 code.en 
mailbox_formatstring

The storage format that the account's mailboxes use.

  • maildir
  • mbox
maildir 
maximum_addon_domains stringThe account's maximum number of addon domains.
  • unlimited
  • An integer that represents a number of addon domains.
unlimited
maximum_databases stringThe account's maximum number of SQL databases.
  • unlimited
  • An integer that represents a number of SQL databases.
unlimited 
maximum_defer_fail_percentagestringThe percentage of failed or deferred email messages that the account can send per hour before outgoing mail is rate-limited.
  • unlimited
  • An integer value.
unlimited 
maximum_email_account_disk_quota 
The maximum size, that the account can define when it creates an email account.
  • unlimited

  • An integer value, in Megabytes (MB).
unlimited 
maximum_emails_per_hourstring

The maximum number of emails that the account can send in one hour.

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of emails.
unlimited 
max_ftp_accountsstringThe account's maximum number of FTP accounts.
  • unlimited
  • An integer that represents a number of FTP accounts.
unlimited 
maximum_mail_accounts stringThe maximum number of email accounts for the account.
  • A positive integer.
  • 0 — unlimited.
0 
maximum_mailing_listsstring

The account's maximum number of mailing lists.

  • unlimited
  • An integer that represents a number of mailing lists.
unlimited 
maximum_parked_domainsstring

The account's maximum number of aliases.

  • unlimited
  • An integer that represents a number of aliases.
unlimited 
maximum_subomainsstringThe account's maximum number of subdomains.
  • unlimited
  • An integer that represents a number of subdomains.
unlimited 
ownerstring

The cPanel account's owner.

  • root
  • A reseller account's username.
  • The cPanel account username.
root 
planstring

The account's hosting package.

The name of a package on the server.packagename
pushbullet_access_tokenstringThe account's Pushbullet access token.A valid Pushbullet token ID.1234567890
shell stringThe account's shell.A shell location on the server./bin/bash
spf_enabled BooleanWhether SPF is enabled.
  • 1 — Enabled.
  • 0 Not enabled.
1 
theme stringThe path to the account's cPanel interface and Webmail theme files, relative to the home directory.
  • /base/frontend/ — the account's cPanel theme.
  • /base/webmail/ — the account's Webmail theme.
/base/frontend/
uid integerThe account's user ID on the system.An integer value.1234 
userstring

The account's current username.

An existing account's username.username 
utf8_mailboxBooleanWhether UTF-8-encoded mailbox names are enabled for the cPanel account.
  • 1 — Enabled.
  • 0 — Not enabled.
1