# add_whitelist
The EvoShield add_whitelist POST endpoint whitelists the provided IP for the specified EvoShield IP.
Parameters
account: The account key - which can be found in the Settings area of the Evolution Host client area: https://evolution-host.com/controlPanelservice_key: The unique key for the particular Evolution Host service being used in this API call - Can be found by using the /list_services API endpointservice_ip: The EvoShield protected IP which the IP should be whitelisted for.whitelist_ip: The IP which will be added to the whitelist.Note: To whitelist Cloudflare's IP ranges, set whitelist_ip to “CLOUDFLARE” in your API request.
/*
Accept all traffic from 1.2.3.4 destined for 123.123.123.123
*/
$url = "https://evolution-host.com/api.php";
$service_ip = '123.123.123.123';
$whitelist_ip = '1.2.3.4';
$postData = http_build_query([
'account' => 'YOUR_ACCOUNT_KEY',
'service_key' => 'YOUR_SERVICE_KEY',
'action' => 'add_whitelist',
'service_ip => $service_ip,
'whitelist_ip' => $whitelist_ip,
]);
$headers = array(
'http' => array(
'method' => "POST",
'ignore_errors' => true,
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $postData,
),
);
$api_context = stream_context_create($headers);
$result = file_get_contents($url, false, $api_context);
$result = json_decode($result);
echo '<pre>' . json_encode($result, JSON_PRETTY_PRINT) . '</pre>';
Example Responses
null
{"error_code":"ERROR_ALREADY_WHITELISTED","description":"Error: 1.2.3.4 is already present in the whitelist for 123.123.123.123"}