· 6 years ago · Feb 28, 2020, 01:52 PM
1NAME VALUE
2bkloc
3optional
4Set this to the URI to a backup location (which will be associated with the defined "user" for the session).
5
6Supported filesystem protocols:
7FTP
8FTPS
9SFTP
10SSH
11WebDAV (HTTP)
12WebDAVS (HTTPS)
13
14Examples:
15ftp://user:pass@server
16sftp://user:pass@server/backups
17ftp://user:pass@server/backups
18webdav://user:pass@server/backups
19
20Further optional arguments that depend on the application (get a full list of fields available for a specific application/version using the browser API):
21
22NAME VALUE
23language
24optional, default is the website's default language or English
25The language of the application to be installed. For example, "en" for English or "zh_tw" for Chinese Traditional. Use the browser API to get a list of available languages for the installed application.
26login
27optional, default is randomly generated value
28The username for the installed application's administrative account.
29passwd
30optional, default is randomly generated value
31The password for the installed application's administrative account. If omitted, a randomized password is assumed.
32sitetitle
33optional, default is "My blog" or similar
34The site title value for the installed application.
35content
36optional, default is "yes"
37Set to "yes" for the sample/demo template.
38Set to "no" for the blank install template.
39Set to the ID of the template for a different template.
40
41List of return values
42NAME VALUE
43result true on success, or false on failure.
44message Success or failure message.
45data Table of installed application information.
46task Table of task information if executed as a background process.
47
48Sample
49curl https://installatron.com/server/v1 \
50 -d "key=8327b11a311aad5a8092d26d209c9e13" \
51 -d "websites[0][id]=ws124" \
52 -d "websites[0][email]=user@mail.com" \
53 -d "websites[0][path]=ftp://website124:password@12.24.36.22" \
54 -d "websites[0][vhosts][http://company.com]=httpdocs" \
55 -d "websites[0][vhosts][http://www.company.com]=httpdocs" \
56 -d "cmd=install" \
57 -d "application=wordpress" \
58 -d "url=http://company.com" \
59 -d "db_name=db123" \
60 -d "db_user=db123" \
61 -d "db_pass=sdfsdf1" \
62 -d "db_host=localhost"
63{
64 "result": true,
65 "message": "",
66 "data": {
67 "id": "3reqf1iduigw0kogk8skgcsoc",
68 "installer": "wordpress",
69 "version": "3.6.1",
70 "language": "en",
71 "time": "1380560311",
72 "agent": "4.0.0",
73 "owner": "dev1",
74 "path": "/home/dev1/public_html",
75 "path-created": "1",
76 "url": "http://company.com",
77 "url-domain": "company.com",
78 "db-host": "localhost",
79 "db-type": "mysql",
80 "db-name": "db123",
81 "db-user": "db123",
82 "db-pass": "sdfsdf1",
83 "db-prefix": "wp_",
84 "title": "My blog",
85 "list-files": [
86 "index.php",
87 "license.txt",
88 ".htaccess",
89 "wp-activate.php",
90 "wp-admin",
91 "wp-app.php",
92 "wp-itapi.php",
93 "wp-blog-header.php",
94 "wp-comments-post.php",
95 "wp-config-sample.php",
96 "wp-config.php",
97 "wp-content",
98 "wp-cron.php",
99 "wp-includes",
100 "wp-links-opml.php",
101 "wp-load.php",
102 "wp-login.php",
103 "wp-mail.php",
104 "wp-settings.php",
105 "wp-signup.php",
106 "wp-trackback.php",
107 "xmlrpc.php"
108 ],
109 "list-tables": [
110 "wp_commentmeta",
111 "wp_comments",
112 "wp_links",
113 "wp_options",
114 "wp_postmeta",
115 "wp_posts",
116 "wp_term_relationships",
117 "wp_term_taxonomy",
118 "wp_terms",
119 "wp_usermeta",
120 "wp_users"
121 ],
122 "autoup": "1",
123 "bkloc": "local",
124 "autobk": "0",
125 "cf-login": "admin",
126 "cf-email": "support@installatron.com",
127 "cf-sitetitle": "My blog",
128 "cf-sitetagline": "Just another WordPress site",
129 "cf-limitloginattempts": "yes",
130 "cache-tables": "87828",
131 "link-admin": "wp-admin",
132 "cache-files": "16105472",
133 "cache-time": "1380560313",
134 "cache-numbackups": "0"
135 }
136}
137Additional Examples
138Command-line inteface JSON input
139echo '{
140 "key": "8327b11a311aad5a8092d26d209c9e13",
141 "websites":
142 [{
143 "id":"ws124",
144 "path":"/var/www/vhosts/company.com",
145 "vhosts":{
146 "http://company.com":"httpdocs",
147 "http://www.company.com":"httpdocs"
148 },
149 "email":"user@mail.com",
150 "uid":153,
151 "gid":153
152 }],
153 "cmd":"install",
154 "application":"wordpress",
155 "url":"http://company.com/blog",
156 "db_name":"db123",
157 "db_user":"db123",
158 "db_pass":"sdfsdf1",
159 "db_host":"localhost"
160}' | /usr/local/installatron/installatron
161HTTP interface URL-encoded input
162curl https://installatron.com/server/v1 \
163 -d "key=8327b11a311aad5a8092d26d209c9e13" \
164 -d "websites[0][id]=ws124" \
165 -d "websites[0][email]=user@mail.com" \
166 -d "websites[0][path]=ftp://website124:password@12.24.36.22" \
167 -d "websites[0][vhosts][http://company.com]=httpdocs" \
168 -d "websites[0][vhosts][http://www.company.com]=httpdocs" \
169 -d "cmd=install" \
170 -d "application=wordpress" \
171 -d "url=http://company.com/blog" \
172 -d "db_name=db123" \
173 -d "db_user=db123" \
174 -d "db_pass=sdfsdf1" \
175 -d "db_host=localhost"
176HTTP interface JSON input
177
178<?php
179$query = array(
180 /* these values define the request header: */
181 "key" => "8327b11a311aad5a8092d26d209c9e13",
182 "websites" => array(
183 array(
184 "id" => "ws124",
185 "path" => "ftp://".urlencode("website124").":".urlencode("password")."@12.24.36.22",
186 "vhosts" => array(
187 "http://company.com" => "httpdocs",
188 "http://www.company.com" => "httpdocs",
189 "https://company.com" => "httpsdocs",
190 "https://www.company.com" => "httpsdocs",
191 ),
192 "email" => "user@mail.com",
193 )
194 ),
195 /* these values define the request body: */
196 "cmd" => "install",
197 "application" => "wordpress",
198 "url" => "http://company.com/blog",
199 "db_name" => "db123",
200 "db_user" => "db123",
201 "db_pass" => "sdfsdf1",
202 "db_host" => "localhost",
203);
204
205$ch = curl_init("https://installatron.com/server/v1");
206curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query));
207
208$reply = curl_exec($ch);
209
210if ( $reply === false )
211{
212 echo "An error occurred: ".curl_error($ch);
213 return;
214}
215
216$reply = json_decode($reply,true);
217
218if ( $reply["result"] === false )
219{
220 echo "An error occurred: ".$reply["message"];
221 return;
222}
223
224echo "Success! ".$reply["message"];