Skip to main content

Comments

4 comments

  • Andy Baugh cPanel Staff

    They work with any browser, and on any OS. You likely just need to replace the relevant bits of the URL with what matches for your server & login. For example:

    https://hostname.example.com:2087/cpsess##########/json-api/cpanel?api.version=1&cpanel_jsonapi_user=user&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=listpopswithdisk

    * hostname.example.com -> This should be translated to the hostname of the server.

    * cpsess########## -> When you login, there will be a 'cpsess' bit of the URL there that has a randomized string after cpsess. Replace the octothorpes there with that randomized string.

    * cpanel_jsonapi_user=user -> replace 'user' with an existing cPanel username on the host.

    Do note that if you are using BASIC authentication that the 'cpsess##########' path component can (and should) be omitted entirely.

    Anyways, most of this information is already outlined in https://api.docs.cpanel.net/whm/introduction/#basic-usage, so those URLs won't make terribly much sense without that guide I'd reckon. Do also be sure that you are using either root or a reseller account on the server to login to WHM with (this won't work with a cPanel or Webmail account for example).

    Hopefully this helps!

    0
  • Jenny Brewer

    The problem isn't the API itself, it's the documentation pages.  For example, on the right hand side of fthis page https://api.docs.cpanel.net/openapi/whm/operation/emailtrack_search/  there is a box headed "Request samples" and another, below it, headed "Response samples" -

    At the top of "Request samples" I can see two tabs, "CLI" and "URL", with a slider beneath them.   The "CLI" appears to be the active one.  The slider is inactive and clicking on URL has no effect.  The "Copy", "Expand All" and "Collapse All" buttons in the "Response samples"  are also inactive.

     

    0
  • Andy Baugh cPanel Staff

    Thank you for the clarification. I talked to the documentation team about this, as that does seem odd. It appears that this breaks when cookies for the site are not accepted. I don't think that is the intended behavior, but nonetheless someone else here was able to replicate that behavior when cookies had not yet been accepted.

    Perhaps if you don't want to accept cookies for the site permanently, you could at least use a private browser window and accept the cookies there to get past this issue?

    In any event, the docs team is investigating what will be needed to fix this and is tracking the issue internally as DOC-20554.

    Hope this helps!

    1
  • cPRex Jurassic Moderator

    Thanks Andy Baugh!!!

    0

Please sign in to leave a comment.