Hi,
Is it possible to update the IP in firewall using Cloudflare API? Currently i’m just able to update only the Notes field but no the IP. Here is my code.
$cfheaders = array(
‘Content-Type: application/json’,
‘X-Auth-Email: xxxxxxxxx’,
‘X-Auth-Key: xxxxxxxxx’
);
$data = array(
‘mode’ => ‘challenge’,
‘notes’ => ‘Test Update here here’,
‘configuration’ => array(‘target’ => ‘ip’, ‘value’ => ‘201.208.186.131’),
);
$json = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘PATCH’);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $cfheaders);
curl_setopt($ch, CURLOPT_URL, ‘https://api.cloudflare.com/client/v4/accounts/xxxxxxxxx/firewall/access_rules/rules/xxxxxxxxx’);
$return = curl_exec($ch);
curl_close($ch);
$returns = json_decode($return,true);