Use IPIC to send a selected IP address or monitoring event to a system you control. This guide explains the easy standard setup, the stronger signed setup and the safe relay option for older GET-only systems.
Important: IPIC sends a request. Your receiving system decides what happens next. Always test with a harmless action before enabling blocking, deletion or other destructive work.
1. Choose the right security mode
Recommended for most admins
Standard secure POST
Uses HTTPS and a dedicated bearer token or API-key header. It is easier to configure and works with many APIs and automation platforms.
Lowest setup effort
Dedicated secret can be revoked
Good protection when HTTPS and a strong token are used
Uses a private signing secret, request timestamp and unique delivery ID. The receiver can prove that the body was not changed and reject replayed requests.
<?php
declare(strict_types=1);
const IPIC_TOKEN = 'replace-with-a-long-random-token';
header('Content-Type: application/json');
if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
http_response_code(405);
echo json_encode(['success' => false, 'error' => 'POST requests only']);
exit;
}
$received = trim((string)($_SERVER['HTTP_AUTHORIZATION'] ?? ''));
if (!hash_equals('Bearer ' . IPIC_TOKEN, $received)) {
http_response_code(401);
echo json_encode(['success' => false, 'error' => 'Invalid token']);
exit;
}
$body = (string)file_get_contents('php://input');
$data = json_decode($body, true);
if (!is_array($data)) {
http_response_code(400);
echo json_encode(['success' => false, 'error' => 'Invalid JSON']);
exit;
}
$ip = trim((string)($data['ip'] ?? ''));
$action = trim((string)($data['action'] ?? ''));
if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
http_response_code(422);
echo json_encode(['success' => false, 'error' => 'Invalid IP address']);
exit;
}
if (!in_array($action, ['block_ip', 'unblock_ip', 'create_ticket'], true)) {
http_response_code(422);
echo json_encode(['success' => false, 'error' => 'Unsupported action']);
exit;
}
if (!empty($data['test'])) {
echo json_encode(['success' => true, 'message' => 'Test accepted. No live action performed.']);
exit;
}
// Call your own firewall, ticketing or automation API here.
// Never place $ip directly into an unescaped shell command.
echo json_encode([
'success' => true,
'message' => 'Request accepted',
'request_id' => (string)($data['request_id'] ?? '')
]);
Use this mode when: your system already accepts bearer tokens or API-key headers and you want the simplest safe configuration.
Stronger verification
4. Advanced signed webhook
IPIC calculates an HMAC-SHA256 signature from the exact timestamp and raw request body. The receiver repeats the calculation using the same private secret.
The small JSON replay store above is suitable only as a simple example. Busy or multi-server systems should store delivery IDs in a database or shared cache with a unique constraint.
Older systems
5. Safe relay for a GET-only destination
Do not put the old GET URL into IPIC. Install a relay on your server. The relay accepts IPIC’s secure POST, validates it, then makes the older request using credentials stored only on your server.
IPIC secure POST → your relay → old GET-only endpoint
Install and configure the receiver. Copy the dedicated token or signing secret once.
Send a test request. IPIC uses a reserved example IP and sets test to true.
Confirm no live change occurred. The receiver should return HTTP 200 and a harmless test message.
Enable the action. Keep confirmation required for destructive actions.
Run one controlled live test. Use a safe test environment or an address you can immediately reverse.
7. Responses IPIC understands
Successful response
HTTP/1.1 200 OK
Content-Type: application/json
{"success":true,"message":"IP accepted"}
Rejected response
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
{"success":false,"error":"Invalid IP address"}
Return a clear HTTP status quickly. Queue slow work after accepting the request rather than making IPIC wait for a long firewall or ticketing operation.
8. Troubleshooting
Message
Likely reason
What to do
Private destination blocked
The hostname resolves to a local, loopback, link-local or reserved address.
Use a publicly reachable HTTPS endpoint. IPIC intentionally cannot call internal network addresses.
Certificate validation failed
The certificate is expired, self-signed or does not match the hostname.
Install a valid public certificate and use the exact certified hostname.
HTTP 401 or 403
The token, API-key header or signature is wrong.
Copy the secret again, check the header name and ensure no spaces or quotes were added.
Signature invalid
The receiver signed reformatted JSON rather than the exact raw body.
Calculate the signature before decoding or changing the body.
Request expired
The server clock differs or processing took too long.
Synchronise the receiver’s clock and allow a maximum age of five minutes.
Duplicate delivery
The same delivery ID was already processed.
Return a safe duplicate response and do not repeat the live action.
Timeout
The receiver is slow, unreachable or waiting on another service.
Respond quickly and queue long-running work.
Redirect rejected
The entered URL redirects to another page.
Enter the final HTTPS endpoint directly. IPIC does not follow redirects.
HTTP 500
The receiver crashed or its local integration failed.
Check the receiver’s own server log. Do not send secrets to support.
9. Rotate, disable or remove access
When a secret may be exposed
Disable the IPIC action immediately.
Generate a new token or rotate the signing secret.
Update the receiver with the new value.
Send a test request.
Re-enable the action only after the test succeeds.
Delete the old secret from the receiver and any password manager entry that is no longer needed.
When removing an integration
Disable or delete the action in IPIC, revoke the token on the receiving system and remove the receiver script if it is no longer used. Existing delivery logs may remain for audit and troubleshooting, but secrets must never be stored in those logs.