Sites

Manage your sites.



Get Sites

HTTP Request

GET https://shiftedit.net/api/sites        

Parameters

Parameter Value Description
Required
login 1 required for authentication
email string login email address
password string login password

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://shiftedit.net/api/sites");

curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
]);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);   ?>
        


Sample Response

{
"sites":
    [{
        "id": (string),
        "user": (string),
        "name": (string),
        "server_type": (string),
        "domain": (string),
        "logon_type": (string),
        "ftp_user": (string),
        "save_password": (string),
        "dir": (string),
        "dir_id": (string),
        "port": (string),
        "pasv": (string),
        "timeout": (string),
        "encryption": (string),
        "upload_on_save": (string),
        "s3_public": (string),
        "check_out": (string),
        "web_url": (string),
        "turbo": (string),
        "encoding": (string),
        "revisions": (string),,
        "db_username": (string),
        "db_password": (string),
        "db_phpmyadmin": (string),
        "ac_wordpress": (string),
        "ac_bootstrap": (string),
        "ac_custom": (string),
        "stack": (string),
        "container_id": (string),
        "status": (string),
        "status_key": (string),
        "git_url": (string),
        "ftp_pass": (string),
        "shared": (boolean)
    }]
}
        



Save Site

HTTP Request

POST https://shiftedit.net/api/sites?cmd=save        

Parameters

Parameter Value Description
Required
login 1 required for authentication
email string login email address
password string login password
name string site reference
Optional
new int whether this is a new site
site int id of site
server_type string Acceptable values:
  • None
  • FTP
  • SFTP
  • Dropbox
  • GDrive
  • GDriveLimited
  • WebDAV
  • AmazonS3
  • AJAX
domain string server domain or host
logon_type string leave blank or key for 'key' authentication
ftp_user string server username
ftp_pass string server password
dir string home directory
port int server port
pasv int ftp pasv mode 0 or 1
encryption int server encryption 0 or 1
s3_public int save s3 files with public access 0 or 1
check_out int enable check in / out
encoding string character encoding e.g. UTF-8
web_url string website url for home directory
db_username string database username
db_password string database password
db_phpmyadmin string URL to phpmyadmin

Sample Code

<?php
//post data
$data = array(
    'name'=> 'my site',
    'new'=> '1',
    'server_type'=> 'FTP',
    'ftp_user'=> 'myuser',
    'ftp_pass'=> 'password',
    'dir'=> '/httpdocs/',
    'pasv'=> '1',
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://shiftedit.net/api/sites?cmd=save");

curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
]);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);   ?>
        


Sample Response

{
	"success": true
}
        



Delete Site

HTTP Request

GET https://shiftedit.net/api/sites?cmd=delete        

Parameters

Parameter Value Description
Required
login 1 required for authentication
email string login email address
password string login password
site int id of site

Sample Code

<?php
//post data
$data = array(
    'site' => '1',
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://shiftedit.net/api/sites?cmd=delete");

curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
]);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);   ?>
        


Sample Response

{
	"success": true
}