v1

latestOpenAPI 3.0.12026-07-17265663.1 KB
Resource Events

Get resource events

All events from resources belonging to devices user is authorized to use are returned in form of a stream, chunk by chunk. Attach your reader and consume event by event. Filters allow you to select devices and resources of interest, and the timestamp filter allows to filter out events and return only those that occurred after a given time. Error response might be returned immediately, but also anytime during the stream reading.

get/api/v1/events

Query parameters

deviceIdstring uuid

Filter by the device id.

resourceIdstring[]

Filter by resource id specified in format {deviceId}{resourceHref}(?etag={etag}). ETag is optional and it is supported only for GET resources.

timestampinteger

Filter by Unix nanoseconds timestamp

Response

Stream of events or error

Example response

[
  {
    "result": {
      "resourceLinksPublished": {
        "resources": [
          {
            "href": "/switches/1",
            "deviceId": "4629b3cb-3a6e-477c-5d50-ccb28ad7c349",
            "resourceTypes": [
              "oic.r.switch.binary"
            ],
            "interfaces": [
              "oic.if.a",
              "oic.if.baseline"
            ],
            "anchor": "",
            "title": "",
            "supportedContentTypes": [],
            "validUntil": "0",
            "policy": {
              "bitFlags": 3
            },
            "endpointInformations": []
          }
        ],
        "deviceId": "4629b3cb-3a6e-477c-5d50-ccb28ad7c349",
        "auditContext": {
          "userId": "9772fcff-dcfb-4db8-a6c9-1b75f2165eb1",
          "correlationId": "ef007f88-6073-4af1-8951-971578bf6803"
        },
        "eventMetadata": {
          "connectionId": "194.1.25.111:61692",
          "sequence": "4",
          "version": "0",
          "timestamp": "1625432924483895839"
        }
      },
      "resourceLinksUnpublished": {
        "hrefs": [
          "/light/1",
          "/light/2"
        ],
        "deviceId": "4629b3cb-3a6e-477c-5d50-ccb28ad7c349",
        "auditContext": {
          "userId": "9772fcff-dcfb-4db8-a6c9-1b75f2165eb1",
          "correlationId": "ef007f88-6073-4af1-8951-971578bf6803"
        },
        "eventMetadata": {
          "connectionId": "194.1.25.111:61692",
          "sequence": "4",
          "version": "0",
          "timestamp": "1625432924483895839"
        }
      }
    }
  }
]