Hello!
I try to use the purge cache api but nothing happens!
I use the following code
$ch = curl_init();
$url = “https://api.cloudflare.com/client/v4/zones/ZONE_ID/purge_cache/”;
$agent = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36’;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
$param = array();
//$param["hosts"] = ["MY_HOST"];
$param['purge_everything'] = true;
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($param));
$headers = [
'Content-Type:application/json',
'Authorization: Bearer MY_TOKEN',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = json_decode(curl_exec($ch),true);
It returns a positive result, but the resources are not updated. What could be the problem?
P.S. When cleaning from the personal account, the update of materials is successful.