While calling from a php page for protecting a document using curl.
It is not returning protected document. Can anyone help me out.
Blockquote
$bearer_token = ‘Authorized Token’;
$protectxlsx_headers = array(
“accept: application/json”,
"authorization: Bearer ".$bearer_token,
“Content-Type: multipart/form-data”,
“x-aspose-client: Containerize.Swagger”,
);
$protectxlsx_data = file_get_contents(‘path to excel file’);
$protectxlsx_ch = curl_init();
curl_setopt($protectxlsx_ch, CURLOPT_URL, ‘https://api.aspose.cloud/v3.0/cells/protect?password=ABCD’);
curl_setopt($protectxlsx_ch, CURLOPT_POST, true);
curl_setopt($protectxlsx_ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($protectxlsx_ch, CURLOPT_HTTPHEADER, $protectxlsx_headers);
curl_setopt($protectxlsx_ch, CURLOPT_POSTFIELDS, $protectxlsx_data);
$protectxlsx_apiresult = curl_exec($protectxlsx_ch);
curl_close($protectxlsx_ch);
$protectxlsx_apiresult_jsondecode = json_decode($protectxlsx_apiresult, true);
Blockquote