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 - link_server_node_with_api_token
Skip to end of metadata
Go to start of metadata

This function links your server to a remote server node. The server uses an API token to communicate with the remote server node.

Important:

  • This function only runs on a Standard Node profile server.
  • You cannot link to a remote server node that uses cPanel & WHM version 76 and earlier. The remote server node must use a version that is the same as or greater than your server version.
  • This function requires the use of an API token. For more information, read our Guide to API Authentication - API Tokens in WHM documentation.
  • In cPanel & WHM version 82, this function only links servers that are capable of mail services. If a server does not have mail service capability, you cannot use this function.

 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/link_server_node_with_api_token?api.version=1&api_token=23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H&hostname=example.com&alias=example&username=root&skip_tls_verification=0
 Command Line
whmapi1 link_server_node_with_api_token api_token=23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H hostname=example.com alias=example username=root skip_tls_verification=0


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)
{
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "link_server_node_with_api_token"
  }
}


Note:

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

ParameterTypeDescriptionPossible valuesExample
aliasstring

Required

A unique name that refers to the remote server node.

A valid name.

Note:

The alias may  only  contain alphanumeric characters, dashes ( - ), and underscores ( _ ). It also has a maximum length of 50 characters.

example
api_tokenstring

Required

The API token required to make API calls to the remote server node.

Note:

The API token must have root-level access on the remote server node.

A valid API token.

23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H

hostnamestring

Required

The remote server node's hostname.

A valid hostname.

Note:

This parameter does not accept an IP address.

example.com
usernamestring

Required

The username required to make API calls to the remote server node.

A valid username.

Note:

The username must have root-level access on the remote server node.

root
skip_tls_verificationBoolean

Whether to skip SSL/TLS verification. The system performs this action when it queries the remote server node.

This value defaults to 0.

  • 1 — Skip SSL/TLS verification.
  • 0 — Do not skip SSL/TLS verification.
0

This function only returns metadata.