API call to check if backup is enabled for user

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello again,

There is a typo the documentation page. The correct parameter backup is not "BACKUPS", but "BACKUP". Therefore, I can modify the backup state for a user like so:

Code:
whmapi1 modifyacct user=myuser BACKUP=0
Regards.
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

If I use your solution, knowing that my script only toggles the backup state, I will have to do one or two more API calls (depending on the situation) to check and set the desired backup state for the backed up user, especially if someone willingly or by mistake changes the state in WHM -> Backup User Selection for the respective user.

Thank you for correcting the documentation and also for pointing out that there is another way of doing this. I will stick to the modify account API call as my script will directly set the backup to the desired state (enabled/disabled).

Regards.
 
  • Like
Reactions: cPanelMichael