Jump to content

How to make API calls to cPanel (or other) servers configured in tblservers?


QuinnP
Go to solution Solved by QuinnP,

Recommended Posts

As the title says, I'm writing an addon module and I'd like to know how I can make API calls to cPanel servers that have the API details stored in tblservers. I wasn't able to find anything in the dev docs, so any examples or documentation would be much appreciated. Thanks!

Link to comment
Share on other sites

  • Solution

okay so to anybody who's wondering... the API key is in plane text which (afaik)... is not how it's supposed to be

https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html#2-general-secrets-management

however this does make my job easier. If anybody else is looking, your cURL requests look something like this:

curl -H 'Authorization: whm {tblservers.username}:{tblservers.accesshash}' 'https://{tblservers.hostname}:{tblservers.port}/json-api/{action}?api.version=1'

Replace the action and the relevant fields from tblservers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated