cPanel application programming interface (API) tokens were introduced in the version 80 of CPanel & WHM. These API tokens can be issued by cPanel users. API Tokens are recognised by the server. It lets other users run API functions with the data of the account. API functions enable one to view as well as change account data, without logging in to the cPanel interface. Let us understand this with the aid of an example. Suppose, one issues an API token to a third-party developer, that token can be used by that third-party developer for checking disk usage.
It needs to be mentioned that API tokens run certain functions. These are UAPI functions and cPanel API 2 functions. If you can’t view this feature, then it has been disabled by your system administrator. You can contact your system administrator, and ask him/her to enable this feature. It is present in the Feature Manager interface in WHM.
WHM >> Home >> Package >> Feature Manager.
Using a cPanel API Token
In order to use a cPanel API token, first you need to create a cPanel API token in the Manage API Tokens interface in cPanel.
cPanel >> Home >> Security >> Manage API Tokens.
Post its creation, the token can be used to run API functions on the server.
Creating an API Token
An API token can be created by one of the below-mentioned methods.
You can use the Manage API Tokens interface in cPanel.
cPanel >> Home >> Security >> Manage API Tokens.
You can use the UAPI Tokens::create_full_access function.
It needs to be mentioned here that in the version 82 of cPanel & WHM, the system does not remove an expired API token. You have to manually delete an API token. An API token can be removed through the Manage API Tokens interface in cPanel.
cPanel >> Home >> Security >> Manage API Tokens.
It can also be removed through the UAPI Tokens::revoke function.
How to Run API Functions with the Token
Remember to use the API token, which you had created in cPanel.
You need to run the below-mentioned command from the command line in order to call a UAPI or cPanel API 2 function with the aid of an API token.
curl -H’Authorization: cpanel username:APITOKEN’
Let us describe the terms used in it.
username – It refers to the username of the cPanel account.
APITOKEN – It refers to the API token.
example.com – It refers to the domain of your cPanel server.
Module – It refers to the API module name.
function – It refers to the name of the API function.
parameter – It refers to the input parameters of the function.
value – It refers to that value which has to be assigned to the input parameter.
Before concluding, let us touch upon cPanel briefly. cPanel is a software that has been developed by the cPanel LLC. It is essentially a web hosting control panel. It provides automation tools and a GUI (Graphical User Interface) for managing a wide range of elements on websites. cPanel is easy to use, and is one if the most popular control panels. It can manage a single hosting account. Now what is hosting?
Hosting or web hosting is a type of service provided by professional web hosting companies. It is meant for making websites accessible over the Internet, and for ensuring their
uninterrupted online availability. Web hosting is of many types, such as shared, VPS, reseller, dedicated, cloud, and WordPress. Website owners should always opt for professional and reliable hosting service providers that are well-equipped to deliver the best quality of web hosting service. For example, the terms, “Top Cloud Hosting Company” and the “Dedicated Server Hosting” indicate that a particular Windows Hosting Company has been successfully providing top-class quality of service to its clients, which has resulted in its global popularity. Opting for the services of any trusted and popular web hosting service provider, such as HTS Hosting, ensures that one always experiences the best and the most seamless web hosting service.
Comments