v1

latestOpenAPI 3.0.12026-07-17265663.1 KB
Resources

Retrieve a resource

The plgd hub builds an up to date Twin for each published resource. Retrieving it's content using this API returnes an eventually consistent shadow content of the resource. There is a possibility to bypass the shadow by setting the query parameter shadow to false or by setting the interface query parameter, which allows you to set the command expiration. If etag is provided, the response will be 304 Not Modified if the resource has not changed otherwise the resource will be returned.

get/api/v1/devices/{deviceId}/resources/{resourceHref}

Query parameters

interfacestring

Defines the view or a way how to interact with a resource.

shadowboolean

Bypass resource shadow and send the GET request directly to the device.

timeToLiveinteger

Command expiration in nanoseconds. 0 means forever and 100ms is minimal value.

onlyContentboolean

Return only content of the resource in the response.

Headers

ETagstring base64

ETag of the resource.

Response

Resource content.

Example response

{
  "data": {
    "resourceId": {
      "href": "/switches/1",
      "deviceId": "4629b3cb-3a6e-477c-5d50-ccb28ad7c349"
    },
    "content": {
      "rt": [
        "oic.r.switch.binary"
      ],
      "if": [
        "oic.if.a",
        "oic.if.baseline"
      ],
      "value": false
    },
    "auditContext": {
      "userId": "9772fcff-dcfb-4db8-a6c9-1b75f2165eb1",
      "correlationId": "e20f1eef-2eeb-4755-b33e-139106d28e2c"
    },
    "eventMetadata": {
      "connectionId": "194.1.25.111:61692",
      "sequence": "7",
      "version": "0",
      "timestamp": "1625427236429144178"
    },
    "status": "OK"
  }
}