im trying to update permissions of a shared file with API, it works when i pass permissions=1, but it doesnt work and says, Shares need at least read when i try to update permissions=2
$data = array(
āpermissionsā => 1, // this works
āpermissionsā => 2, // this doesnt work it says, Shares need at least read permissions
);
$payload = json_encode($data);
$ch = curl_init();
$headers = array();
$headers = āContent-Type: application/jsonā;
$headers = āOcs-Apirequest: trueā;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $this->nc_url.āocs/v2.php/apps/files_sharing/api/v1/shares/123ā);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, āPUTā);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_USERPWD, 'User:Password);
$result = curl_exec($ch);