Accessing Enduser API with CLI

Description

This guide will show you how to access Webuzo Enduser API using a CLI command from the Webuzo server itself. This API is available for all the pages in Webuzo. You just need to adjust the act and the appropriate POST parameters need to be passed via CLI args.
You need to pass the username for which you want to perform the action in "loginAs" argument to the command

Command

Lets take an example of List Domains page. The below command will list all the domains owned by the user "abc"

webuzo --enduser-api --act=domainmanage --loginAs=abc

Now lets try to add a domain under the user "abc"

webuzo --enduser-api --loginAs=abc --act=domainadd --domain=testdomain.com --domain_type=addon --domain_path='/home/abc/testdomain.com' --add=1

In this way you can access any page in Webuzo enduser panel e.g. add domain, add email, add database, list database, etc using the act from the URL and passing the required POST parameters without the need of user password since you are already executing the command as root.
You can find the POST parameters from the Console in your browser when you submit the page in your browser.

Was this page helpful?