SOLVED API function to check one user account for AutoSSL

swbrains

Well-Known Member
Sep 13, 2006
207
28
178
Hi,

I see a function in the API: start_autossl_check_for_one_user

Is there a way to give a reseller privileges to run this function. Right now I need to authenticate as a root user to do so, but I'd like to give permission to a reseller to call it.

Thanks!
 
Last edited:

swbrains

Well-Known Member
Sep 13, 2006
207
28
178
Thanks. How could I accomplish this from a Perl script? That is, I know how to authenticate from the script before calling an API function, but how would I authenticate as the reseller but keep the start_autossl_check function limited to one user?

Thanks!
 

swbrains

Well-Known Member
Sep 13, 2006
207
28
178
No problem. I'm familiar with calling the API/UAPI via Perl. I just wasn't sure about the user's authentication credentials working.
 
  • Like
Reactions: cPanelMichael

swbrains

Well-Known Member
Sep 13, 2006
207
28
178
Next related question: Is there a non-root way via the API to call get_users_features_settings or some similar function to determine if a user account has a particular feature enabled. For example, I want my script to determine if AutoSSL is enabled in the user account's feature list. The aforementioned function works great if I authenticate as root user, but I'd prefer to have a way to get similar information without authenticating as root, if possible.

I should probably clarify here -- I'd like to determine if the setting to enable AutoSSL for this *one* user is enabled/disabled, rather than if the feature is simply enabled in the feature set used by user account. That is, going into WHM->Manage AutoSSL, I can override the default feature set for this user and enable AutoSSL manually for this user without enabling it in the feature set for all users. I need to know if it's been enabled for that one user. The get_users_features_settings function works well for this, allowing me to see if it's enabled for just this user, but requires root authentication.

Thanks!
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

Not directly, but the following UAPI function would provide this information to you:

UAPI Functions - SSL::get_autossl_excluded_domains - Developer Documentation - cPanel Documentation

For example, if AutoSSL is enabled in the feature list associated with the account, yet is disabled for the account via WHM >> Manage AutoSSL >> Manage Users, this UAPI function will return a result like this:

Code:
---
apiversion: 3
func: get_autossl_excluded_domains
module: SSL
result:
  data: ~
  errors:
    - You do not have the feature “autossl”.
  messages: ~
  metadata: {}

  status: 0
  warnings: ~
Thank you.
 

swbrains

Well-Known Member
Sep 13, 2006
207
28
178
Would this work the other way around? That is, AutoSSL is disabled in the global feature list used for all accounts by default, but it is enabled for one account in the Manage AutoSSL page where you override the global feature list for that account.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Would this work the other way around? That is, AutoSSL is disabled in the global feature list used for all accounts by default, but it is enabled for one account in the Manage AutoSSL page where you override the global feature list for that account.
Yes, in that case, the output would show that AutoSSL is not disabled:

Code:
# uapi --user=user123 SSL get_autossl_excluded_domains
---
apiversion: 3
func: get_autossl_excluded_domains
module: SSL
result:
  data: []

  errors: ~
  messages: ~
  metadata:
    transformed: 1
  status: 1
  warnings: ~
Thank you.