Softaculous Enterprise API

If you have a Panel written in PHP, there is a PHP SDK Class written for doing various activities like Installing Apps, Upgrading installations, etc. You can easily start using the SDK functions like install(), updgrade(), etc.

Softaculous Enterprise has a Admin Panel to perform Admin Functions like Adding a Domain, Deleting a Domain, etc and has a Enduser Panel to perform Enduser Functions like Install, Remove, Upgrade the scripts.

Admin Functions

Admin functions are accessible only from port 2006 of your Softaculous Enterprise Server. So make sure the url accessed has the port 2006.

Only root users and resellers can access Admin Functions.

Authenticating

Key

Value

Description

api_key

Random String

API Key is 16 Characters random string provided by Installer.

api_pass

Random String

API Key is 32 Characters random string provided by Installer.

createSession (Optional)

Username of the account.

As an Admin you can create a session of a particular user and give the returned session key to the user to give him access to the Softaculous Enterprise Interface.

api

serialize, json or xml (Default: serialize)

Softaculous Enterprise will return the output in the format specfied.

POST (Optional)

useuser (Optional)

Array

As an Admin you can create a session of a particular user and give the returned session key to the user to give him access to the Softaculous Enterprise Interface.

username

User Name to add or use. If username is already present, Softaculous will use it.

uid

UID of the user.

gid

GID of the user.

add_domain (Optional)

Array

As an Admin you can create a domain of a particular user.

domain

The Domain name

username

The username of the User who owns the domain

path

The web accessible folder/path where your installations will be made. It should be accessible by Softaculous over NFS. Web accessible directory should be owned by user specified.

replace_path

This "Replace Path" will be replaced with empty in PATH to get the correct path according to scripts. According to the scripts PATH mentioned above is not correct as we are on NFS. We have to generate a new path with respect to scripts.

backup_dir

Backup Directory. Softaculous will create backups in this folder. This should be accessible by Softaculous over NFS.

data_dir

Full path of the Data Directory. Some scripts like Elgg, Moodle, etc need a non web accessible folder. Specify accordingly that it can be accessed by Softaculous too which is on NFS.

It is the web accessible folder/path where your installations will be made. It should be accessible by Softaculous over NFS. Web accessible directory should be owned by user specified.

backup_dir

/NFS/a/home/user/backups

It is the Backup Directory. Softaculous will create backups in this folder. This should be accessible by Softaculous over NFS.

replace_path

/NFS/a

This "Replace Path" will be replaced with empty in PATH to get the correct path according to scripts. According to the scripts PATH mentioned above is not correct as we are on NFS. We have to generate a new path with respect to scripts.

data_dir

/NFS/a/home/user/datadir

Full path of the Data Directory. Some scripts like Elgg, Moodle, etc need a non web accessible folder. Specify accordingly that it can be accessed by Softaculous too which is on NFS.

Get Script Info

The value should be "installations" to perform the action of listing installations.

soft

26 (26 is the Script ID of WordPress)

The value should be "SID" for softaculous to perform the action of installing a software. You can find the list of sid's here

giveinfo

1

Pass this value as 1 to get the information of the script (passed in the soft parameter)

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
'api_key=TESTAPIKEY'.
'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
'&api=serialize'.
'&act=software'.
'&soft=26'.
'&giveinfo=1';
// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
if(!empty($post)){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
// Get response from the server.
$resp = curl_exec($ch);
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
print_r($res);
print_r($res['info']['overview']); // will have overview of the script (in HTML format)
print_r($res['info']['features']); // will have features list of the script (in HTML format)
print_r($res['info']['demo']); // will have the link to demo of the script
print_r($res['info']['ratings']); // will have the link to ratings page of the script
print_r($res['info']['support']); // will have the link to script vendor support page
print_r($res['info']['release_date']); // will have the release date of the current version of the script
print_r($res['settings']); // will have an array of the list of fields that the script will require, e.g. site_name, site_desc, language, etc
print_r($res['dbtype']); // if the value is not empty it means the script requires a database, if the value is empty it means that the script does not require a database
print_r($res['cron']); // if the value is not empty it means the script requires a CRON JOB, if the value is empty it means that the script does not require a CRON JOB
print_r($res['datadir']); // if the value is not empty it means the script requires a data directory, if the value is empty it means that the script does not require a data directory

(Optional) - Location id of the backup location where you want to store your current backup. Default value will be the one saved in the installation's settings. You can find the location id from List Backup Locations

noemail

1

(Optional) - Use this only if you do not want to send an email to the user

This will trigger the only_realversion function to list only installations in which the version in Softaculous records do not match with actual installation version

list

array('username-26_68351', 'username-26_68352')

This will contain the array list for the installations which needs to be updated in Softaculous record(you will need to pass installation id which you will get from Real Version response in List Real Version

(Optional) Use this only if you want to add a reseller to the plan. resellers_ is the prefix for adding a reseller and abc is the name of the reseller (that should already exist). Similarly pass a separate key for each reseller you want to add to the plan.

users_xyz

1

(Optional) Use this only if you want to add a user to the plan. users_ is the prefix for adding a user and xyz is the name of the user (that should already exist). Similarly pass a separate key for each user you want to add to the plan.

scripts_26

1

Use this to pass the scripts to be added to the plan. scripts_ is the prefix for adding a script and 26 is the id of the script to be added. Similarly pass a separate key for each script you want to add to the plan. Get Script ids

(Optional) Use this only if you want to assign a reseller to the plan. resellers_ is the prefix for adding a reseller and abc is the name of the reseller (that should already exist). Similarly pass a separate key for each reseller you want to assign to the plan.

users_xyz

1

(Optional) Use this only if you want to assign a user to the plan. users_ is the prefix for assigning a user and xyz is the name of the user (that should already exist). Similarly pass a separate key for each user you want to assign to the plan.

scripts_413

1

Use this to pass the scripts to be assigned to the plan. scripts_ is the prefix for assigning a script and 26 is the id of the script to be assigned. Similarly pass a separate key for each script you want to assign to the plan. Get Script ids

Enable / Disable Script

This will trigger the submit function for enabling/disabling the scripts

soft_26

1

Use it to Enable Script from Admin Panel. soft_ is the prefix for enabling a script and 26 is the id of the script to be enabled. Similarly pass a separate key for each script you want to enable. Get Script ids

Note: If you have 10 scripts Enabled. You want to Enable 1 more script you will need to pass all 11 scripts id in the POST data for it to Enable the script. The scripts which are not posted will be disabled.