Resource Links

Create a resource

This API enables you to create a new resource on a collection supporting create operation - interface oic.if.create shall be present. The resource is automatically published by the device, about what you are informed through an RESOURCE_PUBLISHED event.

post/api/v1/devices/{deviceId}/resource-links/{resourceHref}

Query parameters

timeToLiveinteger

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

Request body

rtstring[] required
ifstring[] required
repobject required

Resource content provided as JSON object or base64 encoded CBOR.

Example request

{
  "rt": [
    "oic.r.switch.binary"
  ],
  "if": [
    "oic.if.a",
    "oic.if.baseline"
  ],
  "rep": {
    "value": false
  },
  "p": {
    "bm": 3
  }
}

Response

Resource create response containing href to a new resource.

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"
  }
}

Changes

Changed in 5 of the 42 revisions of this API.118

    • added the new NOT_MODIFIED enum value to the data/status response property for the response status 200

      response-property-enum-value-added

    • added the optional property error/details/items/typeUrl to the response with the 400 status

      response-optional-property-added

    • added the optional property error/details/items/typeUrl to the response with the 401 status

      response-optional-property-added

    • added the optional property error/details/items/typeUrl to the response with the 403 status

      response-optional-property-added

    • added the optional property error/details/items/value to the response with the 400 status

      response-optional-property-added

    • added the optional property error/details/items/value to the response with the 401 status

      response-optional-property-added

    • added the optional property error/details/items/value to the response with the 403 status

      response-optional-property-added

    • added the new optional query request parameter timeToLive

      new-optional-request-parameter

    • endpoint added

      endpoint-added

    This revision also has 10 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 55 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

Of the 42 revisions, 3 have no diff computed.