Hi, I’m using PHP Library of Cloudflare API => GitHub - cloudflare/cloudflare-php: PHP library for the Cloudflare v4 API
as you can see there is not enoght documention in this github page!
I want to block an IP through API. I wrote this code:
<?php $ip = '62.219.14.1'; require_once('vendor/autoload.php'); $key = new \Cloudflare\API\Auth\APIKey('[email protected]', 'MY_API_KEY'); $adapter = new Cloudflare\API\Adapter\Guzzle($key); $Rules = new \Cloudflare\API\Endpoints\user\firewall\access_rules\rules('block', [ "target" => "ip", "value" => $ip ],date('Y-m-d H:i', strtotime(time())));
But it doesn’t work and returns an error that \firewall\access_rules\rules class doesn’t exist in the library.
What’s wrong with it? How to block an IP?