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
  • WHM API 1 Functions - execute_remote_whmapi1_with_password
Skip to end of metadata
Go to start of metadata

Description

This function executes WHM API 1 functions on a remote server.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/execute_remote_whmapi1_with_password?api.version=1&host=host.example.com&username=username&password=luggage12345&function=passwd&tls_verification=on&parameter_name=user&parameter_value=username2&parameter_name=password&parameter_value=6789luggage
 Command Line
whmapi1 execute_remote_whmapi1_with_password host=host.example.com username=username password=luggage12345 function=passwd tls_verification=on parameter_name=user parameter_value=username2 parameter_name=password parameter_value=6789luggage


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "app" : [
       "system",
       "ftp",
       "mail",
       "MySQL"
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "execute_remote_whmapi1_with_password",
    "output":{
      "warnings":[
        "debug: Established whostmgr session\n"
      ]
    }
  }
}


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
hoststring

Required

The remote server's hostname or IP address.

A valid hostname.host.example.com
usernamestring

Required

The username to log in to the remote server.

A valid username.username
passwordstring

Required

The password to log in to the remote server.

A valid password.luggage12345
functionstring

Required

The name of the function to call on the remote server.

A valid WHM API 1 function.passwd
tls_verificationstring

Whether to use TLS verification.

This parameter defaults to On.

Important:

We strongly recommend that you use TLS verification. Only connect to a server if you can verify its identity.

  • on — Use TLS verification.
  • off — Do not use TLS verification.
on
parameter_namestring

Required

The name of the parameter for the function.

Note:

You must enter the same number of parameter_name and parameter_value parameters.

A valid parameter name.user
parameter_valuestring

Required

The value of the parameter for the function.

Note:

You must enter the same number of parameter_name and parameter_value parameters.

A valid value.username2

Returns

ReturnTypeDescriptionPossible valuesExample
key-name*string

The function's output.

Note:

The system uses the remote function's return name.

A valid possible values.system