Skip to main content

Call Uapi in WHM Plugin

Comments

9 comments

  • cPanelLauren
    Hi @srkumar1986 The following may be helpful for this issue: Thank you,
    0
  • srkumar1986
    Thank you Lauren, I have one more clarification. If any of API process needs to be run only on whm root user, Lets take an example off lets encrypt SSL Certificate process, they are guide to run this process only on root. how i can achieve? what i should give the cpanel_jsonapi_user value?
    0
  • cPanelLauren
    Hello, You should be able to use the whmapi1 to call cPapi2 functions the cpanel_jsonapi_user should be the cPanel user w/no password specified. Can you show me an example of the API function you're using that's providing an error?
    0
  • srkumar1986
    Hello, You should be able to use the whmapi1 to call cPapi2 functions the cpanel_jsonapi_user should be the cPanel user w/no password specified. Can you show me an example of the API function you're using that's providing an error?

    Hello, Here is my URL for reference. https://mydomain.com:2087/cpsess####/json-api/cpanel?api.version=1&cpanel_jsonapi_user=root&cpanel_jsonapi_module=CertificateDetails&cpanel_jsonapi_func=createcertificate&cpanel_jsonapi_apiversion=3&domain_name=mytestdomain.com
    in this createcertificate i have system command to create lets encrypt ssl certificate that accessible only by root user. But i am getting the below error The user "root" is not associated with a cPanel account and cannot call cPanel API 2 currently the plugin is in WHM Console. By default WHM Console will execute all process as root i hope. Please specify my mistake on this. thanks
    0
  • cPanelLauren
    Hello, When running the API you shouldn't be using root as the user, you're running the command as root but the user should be the user you want to generate the certificate for. Furthermore, can you link me to the documentation of this API call, it looks like you're using a cPAPI1 function and I'd like to look at it further. Thank you,
    0
  • srkumar1986
    Hello, When running the API you shouldn't be using root as the user, you're running the command as root but the user should be the user you want to generate the certificate for. Furthermore, can you link me to the documentation of this API call, it looks like you're using a cPAPI1 function and I'd like to look at it further. Thank you,

    Hello, Here is my updated link ,"status":0,"messages":null,"metadata":{},"data":null}} The reference URL I've used as, Use WHM API to Call cPanel API and UAPI - Developer Documentation - cPanel Documentation Thank you!
    0
  • cPanelLauren
    Hello, Thank you for that, but I'm looking for the API you're using for CertificateDetails, do you have that? Thank you,
    0
  • srkumar1986
    Hello, Thank you for that, but I'm looking for the API you're using for CertificateDetails, do you have that? Thank you,

    Hello Lauren, The Perl Module CertificateDetails that you're looking for is custom developed. If you need, i will share it with you. Thanks Rajkumar S
    0

Please sign in to leave a comment.