Hello,
We are using REST Api on PHP without problems until we want to use the addKeyword property,
This is the code:
NullPointerException: null
Thank you
We are using REST Api on PHP without problems until we want to use the addKeyword property,
This is the code:
Code: Select all
after executing this is the error string:$url = "http://http://192.168.1.199:8080/OpenKM/services/rest/property/addKeyword";
$val = array("nodeId" => "d570e064-aff8-4033-861f-8d2b1a99c7da", "keyword" => "clave");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "USER:PASSWORD");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $val);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Accept: application/json",
'Content-Type: application/json'
));
$res = curl_exec($ch);
echo $res;
if (curl_errno($ch)) {
return curl_error($ch);
} else {
return $res;
}
curl_close($ch);
NullPointerException: null
Thank you