Things

Retrieve visible things or things with specified IDs

GET
https://ditto.eclipseprojects.io/api/2/things

Returns all visible things or things passed in by the required parameter ids, which you (the authorized subject) are allowed to read.

Optionally, if you want to retrieve only some of the thing's fields, you can use the specific field selectors (see parameter fields) .

Tip: In order to formulate a filter which things to search for, take a look at the /search resource.

Parameters

idsstringquery

Contains a comma-separated list of thingIds to retrieve in one single request.

fieldsstringquery

Contains a comma-separated list of fields to be included in the returned JSON. attributes can be selected in the same manner.

Selectable fields

  • thingId

  • policyId

  • definition

  • attributes

    Supports selecting arbitrary sub-fields by using a comma-separated list:

    • several attribute paths can be passed as a comma-separated list of JSON pointers (RFC-6901)

      For example:

      • ?fields=attributes/model would select only model attribute value (if present)
      • ?fields=attributes/model,attributes/location would select only model and location attribute values (if present)

    Supports selecting arbitrary sub-fields of objects by wrapping sub-fields inside parentheses ( ):

    • a comma-separated list of sub-fields (a sub-field is a JSON pointer (RFC-6901) separated with /) to select

    • sub-selectors can be used to request only specific sub-fields by placing expressions in parentheses ( ) after a selected subfield

      For example:

      • ?fields=attributes(model,location) would select only model and location attribute values (if present)
      • ?fields=attributes(coffeemaker/serialno) would select the serialno value inside the coffeemaker object
      • ?fields=attributes/address/postal(city,street) would select the city and street values inside the postal object inside the address object
  • features

    Supports selecting arbitrary fields in features similar to attributes (see also features documentation for more details)

  • _namespace

    Specifically selects the namespace also contained in the thingId

  • _revision

    Specifically selects the revision of the thing. The revision is a counter, which is incremented on each modification of a thing.

  • _created

    Specifically selects the created timestamp of the thing in ISO-8601 UTC format. The timestamp is set on creation of a thing.

  • _modified

    Specifically selects the modified timestamp of the thing in ISO-8601 UTC format. The timestamp is set on each modification of a thing.

  • _metadata

    Specifically selects the Metadata of the thing. The content is a JSON object having the Thing's JSON structure with the difference that the JSON leaves of the Thing are JSON objects containing the metadata.

  • _policy

    Specifically selects the content of the policy associated to the thing. (By default, only the policyId is returned.)

Examples

  • ?fields=thingId,attributes,features
  • ?fields=attributes(model,manufacturer),features
timeoutstringquery

Defines how long the backend should wait for completion of the request, e.g. applied when waiting for requested acknowledgements via the requested-acks param. Can be specified without unit (then seconds are assumed) or together with s, ms or m unit. Example: 42s, 1m.

The default (if omitted) and maximum timeout is 60s. A value of 0 applies fire and forget semantics for the command resulting in setting response-required=false.

Response

The successfully completed request contains a list of the for the user available Things, or the Things asked for via the ids paramter. The Things are sorted either by their ID, or in the same order as the Thing IDs were provided in the ids parameter.

Response fields application/json
Show child attributes
thingIdstringrequired

Unique identifier representing the thing

policyIdstringrequired

The ID of the policy which controls the access to this thing. policies are managed by resource /policies/{policyId}

definitionDefinition

A single fully qualified identifier of a definition in the form '::' or a valid HTTP(s) URL

attributesAttributes

An arbitrary JSON object describing the attributes of a thing.

featuresFeatures

List of features where the key represents the featureId of each feature. The featureId key must be unique in the list.

Show child attributes
[key: string]Feature
Show child attributes
definitionArray<string>

The definitions of a feature.

An arbitrary JSON object describing the properties of a feature.

desiredPropertiesFeatureDesiredProperties

An arbitrary JSON object describing the desired properties of a feature.

_revisionstring

(read-only) The revision is a counter which is incremented on each modification of a Thing. This field is not returned by default but must be selected explicitly.

_createdstring

(read-only) The created timestamp of the Thing in ISO-8601 UTC format. The timestamp is set on creation of a Thing. This field is not returned by default but must be selected explicitly.

_modifiedstring

(read-only) The modified timestamp of the Thing in ISO-8601 UTC format. The timestamp is set on each modification of a Thing. This field is not returned by default but must be selected explicitly.

_metadataobject

(read-only) The Metadata of the Thing. This field is not returned by default but must be selected explicitly.

Response fields application/td+json
Show child attributes

A WoT Thing Description version 1.1

@contextArray<string> | stringrequired
Show child attributes
One of
Array<string>https://www.w3.org/2019/wot/td/v1http://www.w3.org/ns/tdhttps://www.w3.org/2022/wot/td/v1.1
stringhttps://www.w3.org/2019/wot/td/v1http://www.w3.org/ns/tdhttps://www.w3.org/2022/wot/td/v1.1
Example
[
  "https://www.w3.org/2022/wot/td/v1.1"
]
titlestringrequired
Example
My fancy Thing
titlesobject
Show child attributes
[key: string]string
descriptionstring
Example
Does fancy stuff with IoT
descriptionsobject
Show child attributes
[key: string]string
@typestring | Array<string>
Show child attributes
One of
string
Array<string>
Example
Thing
idstring
Example
urn:org.eclipse.ditto:my-fancy-thing
basestring<iri-reference>
Example
https://ditto.eclipseprojects.io/api/2/org.eclipse.ditto:my-fancy-thing
versionobject
Show child attributes
modelstring
instancestringrequired
Example
{
  "model": "1.0.0",
  "instance": "1.0.0"
}
securitystring | Array<string>required
Show child attributes
One of
string
Array<string>
Example
basic_sc
securityDefinitionsobjectrequired
Show child attributes
[key: string]object
Example
{
  "basic_sc": {
    "in": "header",
    "scheme": "basic"
  }
}
supportstring<iri-reference>
Example
https://www.eclipse.dev/ditto/
createdstring<date-time>
modifiedstring<date-time>
formsArray<object>
Show child attributes
opstring
hrefstring
htv:methodNamestring
contentTypestring
additionalResponsesArray<object>
Show child attributes
successboolean
schemastring
propertiesobject
Show child attributes
[key: string]object
actionsobject
Show child attributes
[key: string]object
eventsobject
Show child attributes
[key: string]object
uriVariablesobject
Show child attributes
[key: string]object
schemaDefinitionsobject
Show child attributes
[key: string]object
profileArray<string> | string
Show child attributes
One of
Array<string>
string<iri-reference>
400Bad RequestAdvancedError

The request could not be completed. At least one of the defined query parameters was invalid.

Response fields application/json
statusintegerrequired

The HTTP status of the error

errorstringrequired

The error code of the occurred exception

messagestringrequired

The message of the error - what went wrong

descriptionstring

A description how to fix the error or more details

hrefstring

A link to further information about the error and how to fix it

401UnauthorizedAdvancedError

The request could not be completed due to missing authentication.

Response fields application/json
statusintegerrequired

The HTTP status of the error

errorstringrequired

The error code of the occurred exception

messagestringrequired

The message of the error - what went wrong

descriptionstring

A description how to fix the error or more details

hrefstring

A link to further information about the error and how to fix it

414URI Too Long

The request could not be completed due to an URI length exceeding 8k characters.

Authorization

OpenIDConnectopenIdConnect

OpenID Connect Discovery URL. The placeholder is replaced by Swagger UI when configured.

NginxBasichttp (basic)

Eclipse Ditto sandbox demo user (demo1 ... demo9) + password (demo)

Bearerhttp (bearer)

A JSON Web Token issued by a supported OAuth 2.0 Identity Provider.