Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Contact Manager -> Communication Types API

oldchili shared this idea 8 years ago
Open Discussion

As a server administrator I would like to be able to set the contacts used in /var/cpanel/clevels.conf using an API call, to avoid having to manually adjust the settings in the file.

Replies (1)

photo
1

For now, you can get by with a scripted approach using Perl's WWW::Mechanize library (or selenium, etc.).


I wrote a small script and pasted it up on GitHub based on WWW::Mechanize:

https://gist.github.com/troglodyne/a8fc15a7ea895777de2e372b64fc873b


Do be aware that the POST endpoint for scripts2/saveeditcontact will actually *set all values to zero* if you don't pass in every single key found in /var/cpanel/clevels.conf (in the example script I warn about it, but they can be passed in like --CONTACTAIM 1, ...). The script also has a --host flag if you don't wanna operate on 127.0.0.1.

Leave a Comment
 
Attach a file