Rest Api

Introductie

X-Guard is in staat “Alarm Events” door te sturen via HTTPS gebaseerde Webhooks. Deze koppeling biedt de mogelijkheid aan externe systemen om met behulp van een simpele HTTP-server een integratie te schrijven met een eigen platform.

Alle verzoeken verwachten een status HTTP-status 2xx als reactie. Bij een andere status zal de webhook opnieuw proberen het bericht af te leveren over een door ons te definiëren periode van tijd.

JSON payload

Het volgende document bevat een voorbeeld JSON-payload. Alle gemarkeerde lijnen mogen vrij gebruikt worden. Andere lijnen kunnen wellicht ander gedrag vertonen dan aanvankelijk wordt verwacht en het gebruik hiervan is op eigen risico.

Het document bevat meer informatie dan nodig om het alarm te verwerken. Momenteel kunnen we dit bericht niet verder verkorten dan de huidige weergave.

Mist er gewenste functionaliteit? We horen het graag!

Code

{
  // will always be alarm
  "type": "alarm",

  // leading timestamp
  "timestamp": "2019-09-03T09:33:08.227",

  // contains alarm level
  "properties": {

    // ignore
    "levelCode": "notification",

    // Can be -15 (green), -5 (orange), or 0 (red / mandown)
    // Use this to determine the urgency of the alarm.
    // Please note: This property is represented as string 
    "level": "-15",

    // ignore
    "alarmId": "82779196",
    "alarmResourceId": "d27825c1-e1d2-4a65-902a-dde998bd51f2",
    "customerId": "81415229",
    "message": "Test Melding",
    "ruleId": "81415264"

  },

  // bound alarm message, configurable by us, per button or type of alarm
  // do not use this for determining the type of alarm
  "message": "Test Melding",

  // object is the creator of the alarm, this will always be 'type=asset'
  "object": {

    // ignore
    "type": "asset",

    // info contains the actual information about an asset
    // this part is a bit messy because of the 'properties'
    "info": {

      // ignore
      "type": {
        "id": 71057390,
        "resourceId": "ac7fb6ac-22a3-4d0e-a4b1-8f023f203176",
        "name": "X-Guard Alarm"
      },

      // this array can be used, but not all properties are garuanteed to be there for all alarms
      // in order to retreive the user e-mail address you'd have to iterate the property array
      // and look for 'code=email' and then read the value.
      //
      // There are some legacy properties in this list which will be removed without prior notice.
      // The following properties are safe to use (listed by code):
      // - email
      // - phone
      // - sms
      // - allowContact
      // 
      // Only 'code' and 'value' are needed to read the content of an asset property, all other
      // keys can be ignored for most use cases.
      "properties": [{
        "name": "Knox",
        "value": "Nee",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.627",
        "observationType": "Nee, Ja - gratis, Ja - Betaald",
        "typePropertyIdentifier": "72d99b1c-5a05-4f56-88cb-857fa9be2ea4",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "knox",
        "defaultValue": "Nee",
        "hidden": true,
        "locked": true
      }, {
        "name": "03.1 Eigen nummer bij alarm",
        "value": "true",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.549",
        "observationType": "",
        "typePropertyIdentifier": "13a642ab-8770-437a-a3fc-08be905498f0",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "allowEmergencyContact",
        "defaultValue": "true",
        "hidden": false,
        "locked": false
      }, {
        "name": "03.2.2 Beschikbaar NQR",
        "value": "false",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.580",
        "observationType": "",
        "typePropertyIdentifier": "4a6de1f1-b716-4e91-9277-0e8994e330d8",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "allowContactNQR",
        "defaultValue": "false",
        "hidden": true,
        "locked": true
      }, {
        "name": "04.1 Looptijd",
        "value": "2019 t/m 2020",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.564",
        "observationType": "",
        "typePropertyIdentifier": "fc39f996-03de-4847-a685-1b86d5049b16",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "duration",
        "defaultValue": "2019 t/m 2020",
        "hidden": false,
        "locked": true
      }, {
        "name": "01 E-Mail",
        "value": "degger+iphone7@x-guard.nl",
        "valueType": "email",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.671",
        "observationType": "",
        "typePropertyIdentifier": "7146d9f1-6579-4299-83ca-a95cc528e0fe",
        "propertyTypeIdentifier": "a25acda1-0b76-41b8-9978-52ed559e8539",
        "code": "email",
        "defaultValue": "",
        "hidden": false,
        "locked": false
      }, {
        "name": "03.3 High Risk",
        "value": "true",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.653",
        "observationType": "",
        "typePropertyIdentifier": "c94125fa-776c-49ba-bc5b-c349d20e2aee",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "highRisk",
        "defaultValue": "true",
        "hidden": true,
        "locked": false
      }, {
        "name": "03.4 Gebruik NQR",
        "value": "false",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.586",
        "observationType": "",
        "typePropertyIdentifier": "264286a9-00b9-4716-83e8-cf6db7a23ca1",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "allowNQR",
        "defaultValue": "false",
        "hidden": false,
        "locked": true
      }, {
        "name": "02.1 Telefoonnummer",
        "value": "+31627364746",
        "valueType": "mobile",
        "unit": "",
        "lastUpdated": "2019-07-12T09:20:56.635",
        "observationType": "",
        "typePropertyIdentifier": "90e51e2e-3ecf-4650-96d5-62421c0285d9",
        "propertyTypeIdentifier": "39492c31-6885-41c5-a1b8-d3c4b13e3308",
        "code": "phone",
        "defaultValue": "",
        "hidden": false,
        "locked": false
      }, {
        "name": "05 SIM",
        "value": "Excl. Simkaart",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.659",
        "observationType": "",
        "typePropertyIdentifier": "d2c26aa1-d630-4e77-9700-a1bf8d0576b4",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "sim",
        "defaultValue": "Excl. Simkaart",
        "hidden": false,
        "locked": true
      }, {
        "name": "03.2 Beschikbaar",
        "value": "false",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-07-12T07:52:20.852",
        "observationType": "",
        "typePropertyIdentifier": "37f3c86c-6140-431f-9855-204cfdbc632b",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "allowContact",
        "defaultValue": "false",
        "hidden": false,
        "locked": false
      }, {
        "name": "02.3 Inlog",
        "value": "Geen/None",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.620",
        "observationType": "",
        "typePropertyIdentifier": "f1dd3dfd-2645-4464-9d08-0de06282d60b",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "userLogin",
        "defaultValue": "Geen/None",
        "hidden": true,
        "locked": false
      }, {
        "name": "07 Servicedesk",
        "value": null,
        "valueType": "text",
        "unit": "",
        "lastUpdated": null,
        "observationType": null,
        "typePropertyIdentifier": "abd2f10c-a20c-4b47-9752-4f31672599c0",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "servicedesk",
        "defaultValue": "",
        "hidden": false,
        "locked": true
      }, {
        "name": "Alarmtype",
        "value": "Paniek",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.637",
        "observationType": "",
        "typePropertyIdentifier": "43b28a35-808c-4094-9f3c-e369e3fd46e9",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "alarmType",
        "defaultValue": "Paniek",
        "hidden": true,
        "locked": true
      }, {
        "name": "02.2 SMS nummer",
        "value": "+31627364746",
        "valueType": "mobile",
        "unit": "",
        "lastUpdated": "2019-07-12T09:20:56.626",
        "observationType": "",
        "typePropertyIdentifier": "ea238247-5425-4c24-9314-ef140ab551aa",
        "propertyTypeIdentifier": "39492c31-6885-41c5-a1b8-d3c4b13e3308",
        "code": "sms",
        "defaultValue": "",
        "hidden": false,
        "locked": false
      }, {
        "name": "06 Notificaties",
        "value": "E-Mail",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.600",
        "observationType": "",
        "typePropertyIdentifier": "c0e036f9-13d0-40a7-bb56-d91ba2a76e23",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "notifications",
        "defaultValue": "E-Mail",
        "hidden": true,
        "locked": true
      }, {
        "name": "04.2 Abonnement",
        "value": "Demo mode",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.573",
        "observationType": "",
        "typePropertyIdentifier": "8b1a11b5-8bf8-4aac-b204-4e3211cd1e5e",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "subscription",
        "defaultValue": "Demo mode",
        "hidden": false,
        "locked": true
      }, {
        "name": "04.3 Applicentie",
        "value": "false",
        "valueType": "text",
        "unit": "",
        "lastUpdated": "2019-06-21T17:21:22.594",
        "observationType": "",
        "typePropertyIdentifier": "93db33f5-77f8-472c-8a8d-dae9314c4ee0",
        "propertyTypeIdentifier": "a43af1a7-f51d-491f-b658-490b1f5b3458",
        "code": "appLicence",
        "defaultValue": "false",
        "hidden": true,
        "locked": true
      }],

      // can be used to determine what zones the asset is currently in
      // it is not recommended to use this, as it may behave diffrently than expected. 
      //
      // Please use the 'position' key on the root object to determine the position.
      "insideZones": [{
        "id": 78506169,
        "resourceId": null,
        "name": "001 X-Guard kantoor"
      }, {
        "id": 81415247,
        "resourceId": null,
        "name": "Opvolging wereld"
      }],

      // labels are a temporay place for us to safe information on the asset
      // labels might not exists on all assets and the format will likely change
      "labels": {
        "Adress_Home": {
          "code": "address_home",
          "value": "{"lat":52.2441689,"lng":6.211504999999999,"textual":"De Braam, 7421 Deventer, Netherlands"}",
          "numericValue": null,
          "time": "2019-08-19T07:02:47.456",
          "label": null
        },
        "Adress_Work": {
          "code": "address_work",
          "value": "{"lat":52.2441457,"lng":6.2122514,"textual":"De Braam 98, 7421 CB Deventer, Netherlands"}",
          "numericValue": null,
          "time": "2019-08-08T13:55:35.628",
          "label": null
        },
        "Deployment": {
          "code": "seqId",
          "value": "a3cd71a6-2750-4de0-9475-f4c681eb0604",
          "numericValue": null,
          "time": "2019-06-21T17:21:22.763",
          "label": null
        }
      },

      // Contains the customer context
      //
      // Customers in this context are most often companies, not the end user.
      //
      // This is likely to be the same for all events received.
      "customer": {
        "id": 81415229,
        "resourceId": "0f8bc460-8ddd-4c2c-aa31-415cfb4c07e4",
        "name": "06.2 Development"
      },

      // Defined asset groups
      // It is not recommended to use this
      "groups": [{
        "id": 81415253,
        "resourceId": "f54a52d0-212d-4b60-92ad-5987d2374ae5",
        "name": "Alarmcentrale"
      }, {
        "id": 81415254,
        "resourceId": "6d5f8403-9f04-49f4-82eb-91aebe00af09",
        "name": "Paniek"
      }],

      // ignore
      "externalId": "",
      "tracked": true,

      // the following information can be used to identify the user
      // the id and resourceId are static and will never change
      //
      // the name contains the full name entered by the user and may
      // change at any time.
      "id": 82320698,
      "resourceId": "461e10d8-338f-4882-8ef6-3d9e9591e7c7",
      "name": "Jesse Test iPhone 7"
    }
  },

  // this object contains the parsed position
  "position": {

    // ignored in favor of the alarm timestamp in the root
    "timestamp": "2019-09-03T09:32:57.805",
    "receptionTimestamp": "2019-09-03T09:32:57.805",
    "locationTimestamp": "2019-09-03T09:32:57.373",

    // coordinates
    "latitude": 52.28506162276489,
    "longitude": 6.780544593927193,

    // only used for beacon positions
    "floor": 1,

    // gps accuracy
    "accuracy": 0,

    // only available if speed and or altitude is observed
    // not recommended to use
    "speed": null,
    "altitude": null,
    "course": null,

    // ignore
    "positionOutOfOrder": false,
    "valid": true,

    // resolved address
    // the example shows a beacon address which we enriched with information about
    // the room we are currently in.
    "address": "X-Guard IT, Welbergweg 50, 7556 PE Hengelo",

    // ignore
    "textual": null,
    "device": null,

    // ignore
    "insideZones": [{
      "id": 78506169,
      "resourceId": null,
      "name": "001 X-Guard kantoor"
    }, {
      "id": 81415247,
      "resourceId": null,
      "name": "Opvolging wereld"
    }],

    // definitely ignore
    // this array contains information about scanned beacons and wifi
    // it is not possible for us to not send this along at the moment
    "properties": {
      "tag.rssi.calc-4": "?",
      "tag.rssi.calc-3": "?",
      "tag.rssi.calc-2": "?",
      "tag.rssi.calc-1": "?",
      "tag.time-5": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-4": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.id-1": "21003.48526",
      "tag.time-7": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-6": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.id-3": "21003.1753",
      "tag.time-9": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.id-2": "28872.10991",
      "tag.time-8": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.id-5": "21003.56419",
      "tag.id-4": "21003.27802",
      "tag.id-7": "21003.48145",
      "tag.id-6": "21003.27895",
      "tag.id-9": "21003.16825",
      "tag.id-8": "51708.24433",
      "tag.time-1": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-3": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-2": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.rssi-9": "-86.54336666666667",
      "tag.rssi-8": "-70.00325000000001",
      "tag.rssi-7": "-90.5012",
      "tag.rssi-6": "-93.6264875",
      "tag.rssi-5": "-86.0014",
      "tag.rssi-4": "-64.0039",
      "tag.rssi-3": "-89.70947083333333",
      "tag.rssi-2": "-71.00314166666666",
      "tag.rssi-1": "-89.70990416666666",
      "event.code": "LOCR",
      "tag.rssi.calc-9": "?",
      "tag.rssi.calc-8": "?",
      "tag.rssi.calc-7": "?",
      "tag.rssi.calc-6": "?",
      "tag.rssi.calc-5": "?",
      "config.MSISDN": "31627364746",
      "tag.time": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.best.id": "7826.8605",
      "tag.rssi.pri-9": "?",
      "uuid": "D-C8DAEFF6-A142-4EF6-9634-67E53E825718",
      "tag.rssi.pri-5": "?",
      "tag.rssi.pri-6": "?",
      "edge": "smarttracker",
      "tag.rssi.pri-7": "?",
      "tag.rssi.pri-8": "?",
      "tag.rssi.pri-1": "?",
      "tag.rssi.pri-2": "?",
      "tag.rssi.pri-3": "?",
      "tag.id": "7826.8605",
      "tag.rssi.pri-4": "?",
      "tag.type-11": "bt",
      "tag.type-10": "bt",
      "tag.id-15": "21003.59214",
      "tag.rssi.pri": "?",
      "tag.id-13": "7826.8605",
      "tag.id-14": "21003.16873",
      "beacon": "7826.8605",
      "tag.rssi-13": "-74.0026",
      "tag.rssi-14": "-88.00085",
      "tag.rssi-15": "-85.751575",
      "tag.best.type": "bt",
      "rxEvent": "LOCR",
      "tag.rssi-10": "-73.0028125",
      "tag.rssi-11": "-94.376375",
      "tag.rssi-12": "-88.00095",
      "tag.type-7": "bt",
      "tag.type-8": "bt",
      "tag.type-9": "bt",
      "tag.type": "bt",
      "tag.type-3": "bt",
      "cause": "LOCR",
      "tag.type-4": "bt",
      "tag.type-5": "bt",
      "tag.type-6": "bt",
      "tag.type-1": "bt",
      "tag.type-2": "bt",
      "tag.rssi.pri-13": "?",
      "tag.rssi.pri-12": "?",
      "tag.rssi.pri-11": "?",
      "tag.rssi.pri-10": "?",
      "tag.id-11": "21003.30578",
      "tag.id-12": "21003.10477",
      "tag.rssi.calc-15": "?",
      "tag.rssi.pri-15": "?",
      "tag.id-10": "21003.63503",
      "tag.rssi.calc-14": "?",
      "tag.rssi.pri-14": "?",
      "tag.rssi.calc-13": "25.9974",
      "tag.type-13": "bt",
      "tag.rssi.calc-12": "?",
      "tag.type-12": "bt",
      "tag.rssi.calc-11": "?",
      "tag.type-15": "bt",
      "tag.rssi.calc-10": "?",
      "tag.type-14": "bt",
      "tag.time-10": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-12": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.rssi.calc": "25.9974",
      "tag.time-11": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.rssi": "-74.0026",
      "tag.time-14": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-13": "Tue Sep 03 09:32:57 UTC 2019",
      "tag.time-15": "Tue Sep 03 09:32:57 UTC 2019"
    },

    // can be used to determine if a beacon position was used
    // when 'type=beacon', you can show the position as beacon 'indoor' and not GPS based
    "source": {
      "beaconCode": "7826.8605",
      "resourceId": "fa7b77b7-aee2-4b09-b8d3-4d4f9f290ebb",
      "name": "7826.8605,CB:DA:C6:F0:7A:88",
      "id": "81343542",
      "type": "beacon"
    },

    // ignore
    "_events": null,
    "coordinate": null,
    "location": null
  },

  // identifiers
  "id": "32e87ce7-76d0-4930-ada2-bb7d6e7a7fb6",
  "subscriptionId": "9d523003-8896-417b-ba4d-fa0bb4d6b6b0"
  
}

Op zoek naar meer informatie?

X-Guard maakt gebruik van cookies.

Als je onze website gebruikt, ga je ermee akkoord dat we cookies plaatsen. Meer informatie vindt je in ons privacy statement.