$headers = array(‘Authorization : token ac58f367e58****:569aa58d869****’);
$handler = curl_init();
curl_setopt($handler, CURLOPT_URL, $url);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handler, CURLOPT_POST, true);
curl_setopt($handler, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($handler, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($handler);
if ($result === false) {
print_r("curl error".curl_error($handler));
die();
} else {
print_r(curl_getinfo($handler, CURLINFO_HTTP_CODE)."\n");
return $result;
I’m trying to create items using token-based authentication for permission but the server message I’m getting is not permitted