I implement the code below for thread change. The API key is Super user and with full permissions but I get a do_not_have_permission error
Thanks for any help
Code:
// Set the API endpoint URL
$endpoint = 'http://112.45.67.890/api/threads/1';
// Set the API key and API secret
// Set the request parameters
$params = array(
'title' => 'This is a test comment',
'prefix_id' => 1,
'discussion_open' => 1,
'sticky' => 1,
'username' => 'admin',
'tags' => 'test',
'message' => 'This is a test comment',
'user_id' => 1,
);
$apiKey = '*************************';
$headers = array(
'Content-Type: application/x-www-form-urlencoded',
'XF-Api-Key: ' . $apiKey,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo ($response);