Try the fastest and simplest way to install ONLYOFFICE

PHP API Start Backup

Integration questions/issues

PHP API Start Backup

Postby LeoN » Wed Nov 29, 2017 10:05 am

I need more info related to this API:

https://api.onlyoffice.com/portals/meth ... tartbackup

How pass in PHP ASC.Web.Studio.Core.Backup.BackupAjaxHandler+StorageParams

The documentation is unclear about it

This is my partial code:

$data_back = array('storageType' => '1', 'storageParams' => array('FolderId' => 'drive-XXXX-|YYYYY-YYYYYYYY'), 'backupMail' => 'false');

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $backup_start_url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data_back));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: '.$token ));
$errors = curl_error($ch);
$result = curl_exec($ch);
$request_code = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$json_result = json_decode($result);

print_r($json_result);
LeoN
 
Posts: 1
Joined: Wed Nov 29, 2017 9:41 am

Re: PHP API Start Backup

Postby Maxim » Thu Nov 30, 2017 12:39 pm

Hello LeoN!
Please specify what exactly is not unclear about it.
Maxim
 
Posts: 1380
Joined: Tue Oct 11, 2016 2:34 pm


Return to API

Who is online

Users browsing this forum: No registered users and 3 guests

cron