cPanel Tutorials – Manage API Tokens

cPanel Tutorials - Manage API Tokens hi my name is Garrett I'm a technical writer on the documentation team here at cPanel the hosting platform of choice today I'm going to tell you about the cPanel API tokens feature you can create and issue these API tokens before we begin let's answer the question what is an API function an API or application programming interface allows you to interact with a program cPanel and WHM API functions allow you to create modify and remove stuff on your server among other things for example you can create an email account all from the command-line well do this later in the video these tokens allow other users to run API functions without the need to login to cPanel for example you could issue an API token to a third party developer the third party developer could use that token to create an email address they would be able to do all of this from the command line and would never need to login to your cPanel account no need to share your password first login to cPanel the cPanel home interface will appear scroll down to manage API tokens and then click manage API tokens and the manage API tokens interface will appear if you've already created API tokens the list API tokens interface will appear if you haven't created any tokens to create API tokens interface will appear the list API tokens interface displays a list of API tokens that you've already created to search through the list of API tokens and to the name of the token in the search bar I'll enter the word first any tokens that contain the phrase first will appear in the display click the X icon to clear the search let's create a new API token click create at the top of the interface to begin the create an API token interface will appear I'll enter a new API token name new underscore API token in the API token name textbox then I'll click create the token created successfully interface will appear notice the API token with all the letters and numbers think of this token like a password you must store this token in a safe place you will need it later this interface is also the only time that you will be able to see this token if you forget or misplace the API token you will have to revoke it and create another let's copy this token to a safe place I'll click copy if I wanted to create another token I could select the create another token after I click yes I saved my token checkbox but we will only need one for this demonstration instead click yes I saved my token the list API tokens interface will appear if I wanted to manage the API token that I just created I could click manage the manage API token interface will appear in this interface I can change the name of the API token I could enter new underscore API token too and then click update I can also revoke the token from this interface but we'll do that from the list API tokens interface in a minute click update a list API tokens interface will appear finally if I want to revoke one or multiple tokens I could select the checkbox for an individual token or multiple tokens then I can click revoke the revoke selected API tokens interface will appear click revoke selected API tokens to continue the list API tokens interface will appear once again that covers how to create and manage API tokens but how do we use the tokens open a command-line interface I'm going to run a curl command this command tells the computer that we want to interact with the server you can find an exact copy of this command in our documentation from the video description below for this command replace the following values with your actual values use your name enter your cpanel account username API token a long string of numbers and letters replace that with your API token we copied from earlier domain name replace example.com with your cpanel domain name or IP address okay so those are going to be the same every time that you run this token the second part is the API module function and parameter value pairs so for this example we're going to run the email module the API function ad pop the email parameter with new user for the value the password parameter with one two three four five luggage as the value okay so now that we have this all broken down let's run it let's go back and see the email address in cPanel go back to cPanel click the home icon the cPanel home interface will appear scroll down to the email accounts icon click the email accounts icon the email accounts interface will appear you can see the new email address for new user here for more information about cPanel your hosting platform of choice visit our website at cpanel comm or follow us on twitter at cpanel if you enjoyed this video click the cPanel icon to subscribe to our channel and view more tutorials just like this one

Leave a Reply

Your email address will not be published. Required fields are marked *