Retrieving GPS Coordinates for an Event Source in XProtect Webhooks

We want to retrieve the location coordinates of the device or camera that triggered the event in XProtect. We intend to use these coordinates to send a customized WhatsApp notification to the relevant user of our application.

To implement this, we created a custom event and configured a webhook in XProtect. We also added a rule that calls the webhook whenever the custom event is triggered.

For testing purposes, we created an alarm definition that allows us to trigger the custom event manually from the XProtect Smart Client.

When the event is triggered, our external service successfully receives the webhook payload. However, the payload does not contain any location coordinates. We also tried configuring GPS coordinates in the camera information properties, but they were not included in the webhook payload.

We also tested the webhook with motion started pre defined event (whose payload is give bellow) in that also we haven’t got GPS coordinates

Could you please clarify the following:

  1. Does the XProtect webhook payload include the latitude and longitude of the camera or device that triggered the event?

  2. If the webhook contains only the camera, device, or source ID, can we use that ID to retrieve the corresponding GPS coordinates through the MIP SDK, REST API, or another XProtect API?

  3. Does XProtect support storing GPS coordinates as metadata for a camera or another device?

  4. Can custom properties or metadata fields be added to a camera and retrieved when an event is triggered?

  5. What is the recommended approach for including or retrieving the GPS coordinates of the source device in a webhook event?

Payload of Motion detection event

{
    "Event": {
        "EventHeader": {
            "ID": "a3b26c5d-56ac-4fc5-8590-444670d24dfa",
            "Timestamp": "2026-07-28T09:09:14.9622394Z",
            "Type": "System Event",
            "Version": "1.0",
            "Priority": 1,
            "PriorityName": "High",
            "Name": "External Event",
            "Message": "External Event",
            "Source": {
                "Name": "Test Incident",
                "FQID": {
                    "ServerId": {
                        "Type": "XPCO",
                        "Hostname": "jn3q832",
                        "Port": 80,
                        "Id": "40178ce2-b781-4cbd-8dec-f4625757942c",
                        "Scheme": "http"
                    },
                    "ParentId": "40178ce2-b781-4cbd-8dec-f4625757942c",
                    "ObjectId": "e7d9aa98-9a3a-451c-b899-bc635d60c836",
                    "FolderType": 0,
                    "Kind": "c9bdac3f-41dc-4afa-b057-61767a3914b7"
                }
            },
            "MessageId": "0fcb1955-0e80-4fd4-a78a-db47ee89700c"
        }
    },
    "Site": {
        "ServerHostname": "jn3q832",
        "AbsoluteUri": "http://jn3q832/",
        "ServerType": "XPCO"
    }
}

Payload of custom event

{
    "Event": {
        "EventHeader": {
            "ID": "a3b26c5d-56ac-4fc5-8590-444670d24dfa",
            "Timestamp": "2026-07-28T09:09:14.9622394Z",
            "Type": "System Event",
            "Version": "1.0",
            "Priority": 1,
            "PriorityName": "High",
            "Name": "External Event",
            "Message": "External Event",
            "Source": {
                "Name": "Test Incident",
                "FQID": {
                    "ServerId": {
                        "Type": "XPCO",
                        "Hostname": "jn3q832",
                        "Port": 80,
                        "Id": "40178ce2-b781-4cbd-8dec-f4625757942c",
                        "Scheme": "http"
                    },
                    "ParentId": "40178ce2-b781-4cbd-8dec-f4625757942c",
                    "ObjectId": "e7d9aa98-9a3a-451c-b899-bc635d60c836",
                    "FolderType": 0,
                    "Kind": "c9bdac3f-41dc-4afa-b057-61767a3914b7"
                }
            },
            "MessageId": "0fcb1955-0e80-4fd4-a78a-db47ee89700c"
        }
    },
    "Site": {
        "ServerHostname": "jn3q832",
        "AbsoluteUri": "http://jn3q832/",
        "ServerType": "XPCO"
    }
}

The webhook payload itself does not include GPS coordinates for the source item.
When you have the Source ObjectId, you can retrieve the GPS coordinates separately:

If your integration requires both event data and camera metadata, it may be worth considering subscribing to events directly instead of relying on webhooks alone. Depending on your requirements, you can use:

In short, GPS coordinates are not available directly in webhook events, but they can be resolved from the source item using the configuration APIs or the MIP SDK.

I tried using the WebSocket API, but it does not provide sufficient information about the event or camera. Therefore, the best approach appears to be retrieving the camera and event metadata through the REST API.

This what i was receiving in the websocket events

{
    "events": [
        {
            "specversion": "1.0",
            "type": "66bdd008-b856-44b6-b385-b1f6c3f76f1b",
            "source": "cameras/57663052-8d8c-432f-8875-c77c248e032b",
            "id": "ab79001b-f7ec-4472-b745-406a3a3fa6f7",
            "time": "2026-07-30T08:16:36.4114266Z",
            "stategroupid": "137e6804-f29d-418f-b9bf-1b7733b2db95"
        }
    ]
}
{
    "events": [
        {
            "specversion": "1.0",
            "type": "e7d9aa98-9a3a-451c-b899-bc635d60c836",
            "source": "userDefinedEvents/e7d9aa98-9a3a-451c-b899-bc635d60c836",
            "id": "24670078-3347-490d-b6ad-e36cfdb9bdc0",
            "time": "2026-07-30T08:15:50.520686Z"
        }
    ]
}

Then use source. In this example (first event)…

GET /api/rest/v1/cameras/57663052-8d8c-432f-8875-c77c248e032b

Please note that the second event you show does not have any references to a source device, you would not know what camera to show based on the event.

Clarification:

You can lookup (using REST API)

GET /api/rest/v1/userDefinedEvents/e7d9aa98-9a3a-451c-b899-bc635d60c836

However a user defined event does not have a gisPoint property.

Is there any way to add custom data to the event? if yes then how to add it.

For eg.

{
    "events": [
        {
            "specversion": "1.0",
            "type": "66bdd008-b856-44b6-b385-b1f6c3f76f1b",
            "source": "cameras/57663052-8d8c-432f-8875-c77c248e032b",
            "id": "ab79001b-f7ec-4472-b745-406a3a3fa6f7",
            "time": "2026-07-30T08:16:36.4114266Z",
            "stategroupid": "137e6804-f29d-418f-b9bf-1b7733b2db95",
            
            // custom data
            "some_key": "value",
        }
    ]
}

Using analytics events you can add extra metadata and the event will natively have a source that could be the camera. It was never asked if the events are events that you will also raise. Events documentation here.

On the Cameras object there is a CustomProperties field. Documentation here.

How to use

Get the camera including this -
GET /api/rest/v1/cameras/[id]?includeChildren=customProperties

Get the CustomProperty alone (id = camera id)
GET /api/rest/v1/customProperties/{id}

put a new Custom property
PUT /api/rest/v1/customProperties/{id}
body –
{
"displayName": "Custom properties",
"a831b969-6930-4488-b10c-d12026b44cf8": "�<?xml version=\"1.0\" encoding=\"utf-8\"?><Top><p><Name>Property1</Name><Value>test again...</Value></p><p><Name>Property2</Name><Value>test7</Value></p></Top>",
"Id": "7100e330-97c4-4d45-83c4-72052dc884a3"
}

Please note that I for test used this sample to create the first property: Admin Tab

No we will not raise any event. We will just listen to other devices events just to add some information specific to our app to associate the events to our users and also distinguish the event from other events

Maybe you could simply read all the cameras and their GPS positions (GisPoint) up front and then when the event is received you have that information ready available.