Alarm receiver
Configure the camera in HTTP/HTTPS Alarm Server or HTTP Listening mode so it posts alarm events to this Laravel app.
Required event data
Camera checklist
Testing
Production security
Before using real cameras in production, add a shared token so only approved Hikvision devices can post alarm events into the app.
1. Add this to .env
HIKVISION_ALARM_TOKEN=replace-with-a-long-random-token
Use a long random value. Do not use a customer name, site name, or simple password.
2. Send this camera header
X-Hikvision-Token: same-token-value
If the camera UI does not support custom headers, leave the token unset and protect the endpoint with firewall/VPN rules instead.
3. Refresh Laravel config
php artisan config:clear
php artisan config:cache
Run this after changing production environment variables so Laravel reads the new token.
Example payload
Hikvision models vary, but the receiver looks for these common fields and stores the full raw payload for troubleshooting.
<EventNotificationAlert>
<ipAddress>10.0.0.20</ipAddress>
<macAddress>44:19:B6:12:34:56</macAddress>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion detected</eventDescription>
<dateTime>2026-04-26T10:30:00+01:00</dateTime>
<channelID>1</channelID>
</EventNotificationAlert>
Connection test
Enter a camera MAC address and optional token, then copy the generated command into PowerShell to simulate a Hikvision camera alarm.
$AlarmUrl = '{{ $alarmEndpoint }}'
$Token = ''
$Headers = @{}
if ($Token) {
$Headers['X-Hikvision-Token'] = $Token
}
$Body = @'
<EventNotificationAlert>
<ipAddress>10.0.0.20</ipAddress>
<macAddress>44:19:B6:12:34:56</macAddress>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>PowerShell test alarm</eventDescription>
<dateTime>2026-04-26T10:30:00+01:00</dateTime>
<channelID>1</channelID>
</EventNotificationAlert>
'@
Invoke-RestMethod -Method Post -Uri $AlarmUrl -ContentType 'application/xml' -Headers $Headers -Body $Body