Looking to create a tool that will allow me to create IP blocks for my domains on the fly, but I’m getting stuck just trying to authenticate against the API.
I’m using php on my side, but I can’t see where I could be passing bad data.
Hoping someone could take a look at what I have and provide some guidance:
IP = _REQUEST[‘ip’];
$fields = array(
‘notes’=>'Blocked for suspected abuse on '.date(“m/d/y”)
$blockData = json_encode($fields);
$headers = [
$ch = curl_init($url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch,CURLOPT_POSTFIELDS,$blockData); $result = curl_exec($ch);
when I print the results, I always receive the same error:
I have confirmed multiple times that I am using the correct account email and the correct global key (reset the key twice to be sure) and I’m still getting an “Authentication error”. The total lack of description is a little frustrating.
Hoping someone has seen this before and I’m just missing something obvious.
Thanks for any insight you can provide!