Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : Softaculous API documentation

1


Threaded Mode | Print  

 Softaculous API documentation (26 Replies, Read 15010 times)
VPSGuys
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,

When you released Softaculous 4.1.1 last week you stated the following

4) An API interface has been added in Softaculous (Documentations will be available soon).


Where can I find more details about this and when will the documentation be released please?


Jonathan Hamon
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

We are working on the documentation and it should be available soon.
We will let you know once it is done.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
VPSGuys
Group: Member
Post Group: Newbie
Posts: 11
Status:
Quote From : Brijesh July 17, 2012, 3:51 pm
Hi,

We are working on the documentation and it should be available soon.
We will let you know once it is done.


Almost another 2 weeks have passed, when is the documentation going to be finished?

Jonathan Hamon
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

We are sorry for the delay.

I have asked the development team about this and they have confirmed that it should be available within a day or two.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

Sir the API documentation is now ready :
http://www.softaculous.com/docs/API

Sorry for the delay.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
VPSGuys
Group: Member
Post Group: Newbie
Posts: 11
Status:
Quote From : Brijesh July 31, 2012, 1:57 pm
Hi,

Sir the API documentation is now ready :
http://www.softaculous.com/docs/API

Sorry for the delay.


I've tried running this code but updating the correct details for username, password, and domain and adding the include line for the sdk.php but I get the following error

PHP Parse error:  syntax error, unexpected T_VARIABLE in /home/wpsecuri/public_html/apitest.php on line 3

$new = new Softaculous_API();
$new->login = 'https://username:password@nuftp.com:2083/frontend/x3/softaculous/index.live.php'; // cPanel example Login
$data['softdomain'] = 'domain.com'; // OPTIONAL - By Default the primary domain will be used
$data['softdirectory'] = 'wp222'; // OPTIONAL - By default it will be installed in the /public_html folder
$data['admin_pass'] = 'pass';
$data['admin_email'] = 'admin@domain.com';
$data['softdb'] = 'wp222';
$data['dbusername'] = 'wp222';
$data['dbuserpass'] = 'wp222';
$data['site_name'] = 'Wordpess wp222';
$data['admin_username'] = 'admin';
$data['language'] = 'en';
$data['site_desc'] = 'WordPress API Test';

$res = $new->install(26, $data); // 26 is the SCRIPT ID for Wordpress
$res = unserialize($res);
if(!empty($res['done'])){
    echo 'Installed';
}else{
    echo 'Installation Failed<br/>';
    if(!empty($res['error'])){
        print_r($res['error']);
    }
}
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

Sir it seems that you forgot to include the file sdk.php
For eg: you place the file here :
/path/to/softaculous/enduser/sdk.php
then you should use :
include('/path/to/softaculous/enduser/sdk.php');

and also you seem to have used the wrong details in the $new->login and $data variables, the details given in the documentation are just an example and you should replace the values with yours.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
VPSGuys
Group: Member
Post Group: Newbie
Posts: 11
Status:
Quote From : Brijesh August 1, 2012, 4:17 am
Hi,

Sir it seems that you forgot to include the file sdk.php
For eg: you place the file here :
/path/to/softaculous/enduser/sdk.php
then you should use :
include('/path/to/softaculous/enduser/sdk.php');

and also you seem to have used the wrong details in the $new->login and $data variables, the details given in the documentation are just an example and you should replace the values with yours.


Please read my reply and you'll see that I said I changed that however after further tweaking it does not work and gives the error 'Installation Failed'

It seems nothing has been created or copied. I notice that in the sdk.php it seems to refer to version 4.1.3 whereas my Softaculous version is 4.1.2

Please give a full working example where all I need to change is the username, password, and domain to get this to work


Jonathan Hamon
IP: --   

Softaculous API documentation
jigar
Group: Member
Post Group: Newbie
Posts: 27
Status:
Hi,

Can you give us the error details ?

Code

if(!empty($res['error'])){
    print_r($res['error']);
}


This code should give you the error details.
IP: --   

Softaculous API documentation
VPSGuys
Group: Member
Post Group: Newbie
Posts: 11
Status:
Quote From : jigar August 1, 2012, 10:29 am
Hi,

Can you give us the error details ?

Code

if(!empty($res['error'])){
    print_r($res['error']);
}


This code should give you the error details.


Please read my post fully

error shown: Installation failed

IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

After the text "Installation Failed" it should print the array of Errors occured.

Can you please open a support ticket with the code you are using or can you email me the file so that we can check it.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
VPSGuys
Group: Member
Post Group: Newbie
Posts: 11
Status:
Quote From : Brijesh August 1, 2012, 11:14 am
Hi,

After the text "Installation Failed" it should print the array of Errors occured.

Can you please open a support ticket with the code you are using or can you email me the file so that we can check it.


Nothing other than 'Installation Failed' is displayed I've emailed you the code I'm using. By all means post here or email back to me a better example.
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

I am looking through the code that you sent. I will check it and get back to you asap.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

Sir we have emailed you with the details and the patch.
You can now try to use the API and it will work.

Sorry for the Inconvenience.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
I'm having the same problem with API installs, I just get "Installation Failed" and there is no array of errors. The variable $res just returns 1. I entered the code exactly as it is in the example, the WordPress install and I did include the sdk.php file at the top.

Other API functions work. I can list all of the scripts without a problem. I can list installs through the API, but install does not work.
IP: --   

Softaculous API documentation
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Quote From : earthrise July 9, 2013, 5:09 am
I'm having the same problem with API installs, I just get "Installation Failed" and there is no array of errors. The variable $res just returns 1. I entered the code exactly as it is in the example, the WordPress install and I did include the sdk.php file at the top.

Other API functions work. I can list all of the scripts without a problem. I can list installs through the API, but install does not work.


Which version of Softaculous are you using. Also can you please email us the code ?


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
I'm using version 4.2.5, which it says is the latest version. Here's the code, of course I removed the real passwords and domains:

<?php
@set_time_limit(100);

include_once('sdk.php');

$new = new Softaculous_API();
$new->login = 'https://pass@domain.com:2083/frontend/x3/softaculous/index.live.php';

// Domain Name
$data['softdomain'] = 'domain.com'; // OPTIONAL - By Default the primary domain will be used

// The directory is relative to your domain and should not exist. e.g. To install at http://mydomain/dir/ just type dir. To install only in http://mydomain/ leave this empty.
$data['softdirectory'] = 'wp887'; // OPTIONAL - By default it will be installed in the /public_html folder

// Admin Username
$data['admin_username'] = 'admin';

// Admin Pass
$data['admin_pass'] = 'pass';

// Admin Email
$data['admin_email'] = 'admin@domain.com';

// Database
$data['softdb'] = 'wp887';

//Database User Name
$data['dbusername'] = 'wp887';

// DB User Pass
$data['dbuserpass'] = 'wp887';

// Language
$data['language'] = 'en';

// Site Name
$data['site_name'] = 'Wordpess wp887';

// Site Description
$data['site_desc'] = 'WordPress API Test';

print_r($res);

// Response
$res = $new->install(26, $data); // Will install WordPress(26 is its script ID)

// Unserialize
$res = unserialize($res);

// Done/Error
if(!empty($res['done'])){
    echo 'Installed';
}else{
    echo 'Installation Failed<br/>';
    print_r($data);
    print_r($res['error']);
    if(!empty($res['error'])){
        print_r($res['error']);
    }
}
?>
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
I put some debugging code in sdk.php and found that it is not returning anything in $this-iscripts. The lists of install scripts is coming back null. I can however list scripts. That part works.
IP: --   

Softaculous API documentation
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Quote From : earthrise July 9, 2013, 8:18 am
I put some debugging code in sdk.php and found that it is not returning anything in $this-iscripts. The lists of install scripts is coming back null. I can however list scripts. That part works.


Hi,

Okay. Access the following link in your browser :
https://domain.com:2083/frontend/x3/softaculous/index.live.php?api=serialize

Let us know if you getting a serialized data in the browser.

If you can debug more in sdk.php, check the response of $resp in function list_installed_scripts(). i.e before and after unserializing the data. $resp should be an array after unserializing.

You can also open a ticket here :
http://softaculous.com/support

We will look into it.


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
I only get it if I add the cpsess to the URL. Otherwise I get a SSL error. Could that be the problem?
IP: --   

Softaculous API documentation
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Quote From : earthrise July 9, 2013, 2:29 pm
I only get it if I add the cpsess to the URL. Otherwise I get a SSL error. Could that be the problem?


From API cpsess is not needed, but yes from browser it is needed.

Sir can you install WordPress from our enduser panel ?

Also did to try to debug sdk.php ?


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

Are you using the premium version or the free one ?

WordPress is not included in the free version of Softaculous.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
I started with the free version, but upgraded to premium. I did have a problem with my login string, it was not correct. Now I'm getting the error:

Array ( [softdomain] => The path of the domain you selected could not be found. )
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
Do I need to upgrade anything? I refreshed the license and it says Premium.
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
Also tried removing the softdomain and softdirectory array items so that it would use the default.
IP: --   

Softaculous API documentation
earthrise
Group: Member
Post Group: Newbie
Posts: 9
Status:
Ok, it's working, thank you. Was logging into the wrong domain. Got it now. Thanks for your help.
IP: --   

Softaculous API documentation
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

Glad to know it works now.

Feel free to contact us if you face any issues.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

« Previous    Next »

Threaded Mode | Print  

1


Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 28, 2024, 7:18 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.086