screwtape

Registered
May 21, 2020
2
0
1
Johannesburg
cPanel Access Level
Reseller Owner
Hi Guys. Im sort of new to APIs in general. I am tying to test the WHM API by creating an account. I am using POSTMAN to run this:

Code:
https://web2004.websitewelcome.com:2087/json-api/createacct?api.version=1&username=usrnametest&domain=dmntest.com&[email protected]
Im using API Key, except i'm not sure what Key and Value should be. I know the API Key i created in my WHM panel should go to one of these.
 

cPSamuel

Well-Known Member
Staff member
Nov 20, 2019
71
13
83
USA
cPanel Access Level
Root Administrator
Hello,

Thank you for contacting cPanel!

To call API functions through a web browser, you must first log in to WHM or cPanel. You will find more information about using the API via the web browser on the following pages:

https://documentation.cpanel.net/display/DD/Guide+to+WHM+API+1

https://documentation.cpanel.net/display/DD/Guide+to+API+Authentication+-+Browser-Based+Authentication

https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+createacct

Once you login to WHM, you will see an automatically generated token in the URL resembling cpsess##########. This token is valid only for the current login session. Once this token is generated, you can copy it from your WHM URL, and paste it into the URL you are using for your API call. The example URL you shared with us would then become:

Code:
https://web2004.websitewelcome.com:2087/cpsess##########/json-api/createacct?api.version=1&username=usrnametest&domain=dmntest.com&[email protected]
I hope you find this helpful. Let us know if you have any questions.