Infocenter notifications

To start getting infocenter notifications about changed objects you need to contact our support and let us know for which project you want to retrieve notifications. We'll then create the needed queues and keys which you then can include in your application. We're using Azure Storage Queues which you need to listen and react on. For example Azure Storage Queue client library for JavaScript

Possible message types:

  • Changed
  • Deleted
  • Collapsed

Message data includes the following properties:

Property Type Description
@id string json-id: full URL to load the object (based on identifier)
type string object type
identifier string object identifier
TargetIdentifier string[] target vertex id when an object was merged / collapsed
project string[] list of affected projects

Example message if a vertex was created or changed:

{
  "id": "0d6c3ce1-2042-4b9b-85ee-6c1dd6fe3bb0",
  "subject": "/Tour/tou_4kq_eiehcdbe",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/tours/tou_4kq_eiehcdbe",
    "Type": "Tour",
    "Identifier": "tou_4kq_eiehcdbe",
    "Project": ["ds-discover"]
  },
  "eventType": "Changed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-23T07:21:34.3933366Z"
}

If a vertex was collapsed or if the type has changed then two messages will be sent. The first collapsed message for the old vertex and the second changed message for the new target vertex.

{
  "id": "a833917d-5223-4166-a70d-ef26c0fc0d8c",
  "subject": "/Place/plc_4kq_cdjcgiaa",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/places/plc_4kq_cdjcgiaa",
    "Type": "Place",
    "Identifier": "plc_4kq_cdjcgiaa",
    "TargetIdentifier": "log_4kq_cdjcgiaa",
    "Project": ["ds-discover"]
  },
  "eventType": "Collapsed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-24T09:12:44.7243537Z"
},
{
  "id": "bcee6974-5c5c-4d4c-994a-ee63ec692411",
  "subject": "/LodgingBusiness/log_4kq_cdjcgiaa",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/lodgingbusinesses/log_4kq_cdjcgiaa",
    "Type": "LodgingBusiness",
    "Identifier": "log_4kq_cdjcgiaa",
    "Project": ["ds-discover"]
  },
  "eventType": "Changed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-24T09:12:46.1744453Z"
}

If a vertex was split then one split message is created with the id of the related vertex and the target vertex id. If based on the split a vertex is no longer in a specific project then for the removed project a Delete message is created. Additional two changed messages will be created for both changed vertexes.

{
  "id": "2c4bd1b7-fe99-46ec-b7df-e68baceff29e",
  "subject": "/FoodEstablishment/foo_px9-s28_baaajga",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/foodEstablishments/foo_px9-s28_baaajga",
    "Type": "FoodEstablishment",
    "Identifier": "foo_px9-s28_baaajga",
    "Project": ["ds-web", "ds-app"]
  },
  "eventType": "Deleted",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-24T21:28:37.9061302Z"
},
{
  "id": "cadfa708-720b-4fd2-803f-cf8ced99eaf0",
  "subject": "/FoodEstablishment/foo_px9-s28_baaajga",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/foodEstablishments/foo_px9-s28_baaajga",
    "Type": "FoodEstablishment",
    "Identifier": "foo_px9-s28_baaajga",
    "Project": ["ds-demo", "ds-discover", "ds-web", "ds-app"],
    "TargetIdentifier": "plc_4kq_cdjcgiaa"
  },
  "eventType": "Splitted",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-24T21:28:37.8382808Z"
},
{
  "id": "0b387229-ac76-4561-9c89-c9b859f740ca",
  "subject": "/FoodEstablishment/foo_px9-s28_baaajga",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/foodEstablishments/foo_px9-s28_baaajga",
    "Type": "FoodEstablishment",
    "Identifier": "foo_px9-s28_baaajga",
    "Project": ["ds-demo", "ds-discover"]
  },
  "eventType": "Changed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-24T21:28:37.8932359Z"
},
{
  "id": "ca2b8a7f-1a86-4061-8185-0c31303b7a49",
  "subject": "/Place/plc_4kq_cdjcgiaa",
  "data": {
    "@id": "https://api.discover.swiss/info/v2/places/plc_4kq_cdjcgiaa",
    "Type": "Place",
    "Identifier": "plc_4kq_cdjcgiaa",
    "Project": ["ds-web", "ds-app"]
  },
  "eventType": "Changed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-08-24T21:28:39.1045868Z"
}

Last update: February 1, 2024 17:37:15