Hi,
I am trying to Delete dns record using PHP and for that I am translating CURL example as on cloudflare API docs into PHP as:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $cf_api_baseurl.“zones/”.$zoneid."/dns_records".$record);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘DELETE’);
$headers = array();
$headers = ‘X-Auth-Email: ‘.$email.’’;
$headers = ‘X-Auth-Key: ‘.$apikey.’’;
$headers = ‘Content-Type: application/json’;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo ‘Error:’ . curl_error($ch);
}
curl_close ($ch);
But I am getting
{
“code”: 1001,
“error”: “method_not_allowed”
}
What am I doing wrong? Help please. Thanks