Hi,
The WHM get_domain_info does not return the list of all the domain name configured on a server when used with an API Token with the bare minimum permission (not a root access token).
It only returns the domains configured on accounts owned by root.
If an account it is not owned by root and the API Token is not an "all access" one, the domain on those resellers accounts are not listed.
For me, it's an unexpected behavior.
I don't want to create an "all root access token" just to have the possibility of retrieving the domains names configured on a hosting server.
I want to use API Token to limit what a token can do and avoid storing a root password.
It's not the only time that a problem of this kind occurs.
I had the same permission problem with the API to suspend an account.
The resellers account can't be suspended unless we use a "root access api token". You can check on the opened cPanel case, it has been a few months that this was reported... (no new about this issue, another case that is going to die... but now I'm used to it "yeah, we opened a cPanel case, here is the number" and then nothing. It just a way of closing tickets)
There is a problem with the API Token system, it's not granular enough.
Some operation requires root token when this can (and should) be avoided.
And, the cherry on top, it's not documented clearly on the cPanel doc. A warning message could be nice.
The WHM get_domain_info does not return the list of all the domain name configured on a server when used with an API Token with the bare minimum permission (not a root access token).
It only returns the domains configured on accounts owned by root.
If an account it is not owned by root and the API Token is not an "all access" one, the domain on those resellers accounts are not listed.
For me, it's an unexpected behavior.
I don't want to create an "all root access token" just to have the possibility of retrieving the domains names configured on a hosting server.
I want to use API Token to limit what a token can do and avoid storing a root password.
It's not the only time that a problem of this kind occurs.
I had the same permission problem with the API to suspend an account.
The resellers account can't be suspended unless we use a "root access api token". You can check on the opened cPanel case, it has been a few months that this was reported... (no new about this issue, another case that is going to die... but now I'm used to it "yeah, we opened a cPanel case, here is the number" and then nothing. It just a way of closing tickets)
There is a problem with the API Token system, it's not granular enough.
Some operation requires root token when this can (and should) be avoided.
And, the cherry on top, it's not documented clearly on the cPanel doc. A warning message could be nice.
Last edited by a moderator: