Revisions

Access file revisions.



Get Revision Files

Gets file paths that have revisions

HTTP Request

POST https://shiftedit.net/api/revisions?site=SITE_ID        

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(
    'site' => '1'
);        
        
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://shiftedit.net/api/revisions?site=SITE_ID");

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

{
    "files": [
    	"test\/test1.html",
    	"test\/test2.html"
    ]
}
        



Get Revisions

HTTP Request

POST https://shiftedit.net/api/revisions?site=SITE_ID&file=FILE_ID&no_content=0        

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/revisions?site=SITE_ID&file=FILE_ID&no_content=0");

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

{
    "revisions":
        [{
            "id": "100000",
            "date": "2014-05-21 12:52:03",
            "content": "hello world",
            "author": "me"
        }]
}
        



Get Revision

HTTP Request

POST https://shiftedit.net/api/revisions?site=SITE_ID&revision=REVISION_ID        

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/revisions?site=SITE_ID&revision=REVISION_ID");

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

{
    "id": "100000",
    "content": "hello world"
}