APIs DMO API Discovery and Filtering

A GET request on any resource of the Device Management Orchestrator (DMO) API retrieves that resource. If you add the rcn (result content) query parameter, the same request becomes a discovery request instead. DMO then searches the subtree below the target resource and returns what it finds. You can narrow the search down by resource type (ty), labels (lbl), individual attributes and depth (lvl), and page through long results with limit and offset.

This page walks through these options with example calls and responses. For the complete list of parameters, see the DMO API reference .

Example resource tree

The examples on this page use the fictional ACME IoT scenario from the DMO API reference . The acme-iot CSEBase contains the following resources (the automatically provisioned tenantInformation resource is left out for brevity):

acme-iot                    CSEBase (ty=5)
├── WeatherNode             Node (ty=14)
│   ├── deviceInfo          ManagementObject (ty=13)
│   └── battery             ManagementObject (ty=13)
├── WeatherStation          AppEntity (ty=2)          lbl: site:berlin
│   ├── alerts              Container (ty=3)
│   └── telemetry           Container (ty=3)          lbl: site:berlin
│       └── reading-001     ContentInstance (ty=4)    lbl: site:berlin
└── FleetTracker            AppEntity (ty=2)
    └── routes              Container (ty=3)          lbl: site:berlin

Set these variables before running the requests:

# Include the API version and CSEBase name in the URL.
API_URL="<dmo_api_url>/v3/acme-iot"
ACCESS_TOKEN="<access_token>"

Resource IDs and timestamps in the responses are assigned by DMO and will differ in your environment.

Query parameters

ParameterDescription
rcnResult content. Selects what the response contains: 1 (default), 4, 6 or 8. See Result content .
tyFilters by resource type. Repeat the parameter to allow several types (ty=3&ty=4). See Filter by resource type .
lblFilters by label, either key:value or just key. See Filter by label .
Attribute filtersFilters by any resource attribute, for example rn=telemetry. See Filter by attributes .
lvlLimits the search depth below the target resource. 1 returns direct children only, -1 (default) means no limit. See Limit the search depth .
limitMaximum number of direct children of the target resource to return. See Pagination .
offsetNumber of direct children of the target resource to skip. Starts at 0. See Pagination .

ty, lvl, limit and offset only have an effect on discovery requests (rcn=4, rcn=6 and rcn=8). Label and attribute filters also work on a normal retrieve (rcn=1), but there they are checked against the target resource itself. If it doesn’t match, DMO responds with HTTP 404 and X-M2M-RSC: 4004.

Result content (rcn)

The rcn parameter decides what you get back:

rcnResponse containsType of request
1The attributes of the target resource. This is the default when rcn is omitted.Retrieval
4The attributes of the target resource and the discovered resources below it, nested hierarchically.Discovery
8Only the discovered resources below the target resource, nested hierarchically. The attributes of the target resource are omitted.Discovery
6A flat list of references (name, type and path) to the discovered resources, without their attributes. The target resource itself is not part of the list.Discovery

Other rcn values are not supported. DMO rejects them with HTTP 501 and X-M2M-RSC: 5001.

Retrieve the resource (rcn=1)

This is a normal retrieve request. DMO returns only the target resource, no matter whether you send rcn=1 or leave the parameter out. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET "$API_URL/WeatherStation/telemetry" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-1" \
--header "Accept: application/json"
{
  "m2m:cnt": {
    "rn": "telemetry",
    "mni": 100,
    "mbs": 51200,
    "lbl": [
      "site:berlin"
    ],
    "ty": 3,
    "st": 1,
    "cbs": 52,
    "cni": 1,
    "cr": "S-ws-berlin-001",
    "ri": "6a8c6780f9881c500060df94",
    "pi": "6a8c6644f9881c500060df88",
    "ct": "20260824T154712,350000",
    "lt": "20260824T154829,539000"
  }
}

Resource with discovered child resources (rcn=4)

Here the target resource comes back together with everything found below it. The child resources are grouped by type (for example m2m:cin for ContentInstances) and nested under their parent, so the response mirrors the resource tree. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET "$API_URL/WeatherStation/telemetry?rcn=4" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-2" \
--header "Accept: application/json"
{
  "m2m:cnt": {
    "rn": "telemetry",
    "mni": 100,
    "mbs": 51200,
    "lbl": [
      "site:berlin"
    ],
    "ty": 3,
    "st": 1,
    "cbs": 52,
    "cni": 1,
    "cr": "S-ws-berlin-001",
    "ri": "6a8c6780f9881c500060df94",
    "pi": "6a8c6644f9881c500060df88",
    "ct": "20260824T154712,350000",
    "lt": "20260824T154829,539000",
    "m2m:cin": [
      {
        "rn": "reading-001",
        "con": {
          "temperature": 18.4,
          "humidity": 72,
          "pressure": 1013.2
        },
        "cnf": "application/json:0",
        "cs": 52,
        "lbl": [
          "site:berlin"
        ],
        "ty": 4,
        "ri": "6a8c67cdf9881c500060df95",
        "cr": "S-ws-berlin-001",
        "pi": "6a8c6780f9881c500060df94",
        "ct": "20260824T154829,539000",
        "lt": "20260824T154829,539000"
      }
    ]
  }
}
ContentInstances in Discovery Results
For each Container in the result, DMO returns at most its newest mni (maximum number of instances) ContentInstances. To read only the newest or oldest ContentInstance of a Container, address it directly with the virtual resource names la (latest) or ol (oldest), for example GET $API_URL/WeatherStation/telemetry/la.

Discovered child resources only (rcn=8)

rcn=8 works like rcn=4, except that the attributes of the target resource are left out. The response is still wrapped in the target’s resource type, which is m2m:ae in this example. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET "$API_URL/WeatherStation?rcn=8&ty=3" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-3" \
--header "Accept: application/json"
{
  "m2m:ae": {
    "m2m:cnt": [
      {
        "rn": "alerts",
        "mni": 50,
        "ty": 3,
        "st": 0,
        "cbs": 0,
        "cni": 0,
        "cr": "S-ws-berlin-001",
        "ri": "6a8c677cf9881c500060df92",
        "pi": "6a8c6644f9881c500060df88",
        "ct": "20260824T154708,551000",
        "lt": "20260824T154708,551000"
      },
      {
        "rn": "telemetry",
        "mni": 100,
        "mbs": 51200,
        "lbl": [
          "site:berlin"
        ],
        "ty": 3,
        "st": 1,
        "cbs": 52,
        "cni": 1,
        "cr": "S-ws-berlin-001",
        "ri": "6a8c6780f9881c500060df94",
        "pi": "6a8c6644f9881c500060df88",
        "ct": "20260824T154712,350000",
        "lt": "20260824T154829,539000"
      }
    ]
  }
}

References to discovered resources (rcn=6)

Sometimes you only need to know which resources exist, for example to address them in follow-up requests. In that case rcn=6 is the lightest option. Instead of full resources, it returns a flat m2m:rrl (resource reference list), where each rrf entry holds the resource name (nm), type (typ) and path (val). The list is ordered depth-first, so every resource is directly followed by the resources below it. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET "$API_URL/WeatherStation?rcn=6" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-4" \
--header "Accept: application/json"
{
  "m2m:rrl": {
    "rrf": [
      {
        "nm": "alerts",
        "typ": 3,
        "val": "acme-iot/WeatherStation/alerts"
      },
      {
        "nm": "telemetry",
        "typ": 3,
        "val": "acme-iot/WeatherStation/telemetry"
      },
      {
        "nm": "reading-001",
        "typ": 4,
        "val": "acme-iot/WeatherStation/telemetry/reading-001"
      }
    ]
  }
}

Filter by resource type (ty)

The ty parameter limits the result to certain resource types. You can repeat it to allow more than one type, for example ty=3&ty=4, in which case resources of any of the listed types are returned.

tyResource type
1AccessControlPolicy
2AppEntity (Application Entity)
3Container
4ContentInstance
5CSEBase
13ManagementObject
14Node
23Subscription
28FlexContainer

For example, this request lists all AppEntities of the tenant. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET "$API_URL?rcn=8&ty=2" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-5" \
--header "Accept: application/json"
{
  "m2m:cb": {
    "m2m:ae": [
      {
        "rn": "WeatherStation",
        "api": "N-ACME-WeatherStation",
        "rr": false,
        "lbl": [
          "site:berlin"
        ],
        "ty": 2,
        "ri": "6a8c6644f9881c500060df88",
        "aei": "S-ws-berlin-001",
        "cr": "S-ws-berlin-001",
        "pi": "acme-iot",
        "ct": "20260824T154156,484000",
        "lt": "20260824T154653,600000",
        "nl": "6a8c66a7f9881c500060df8b"
      },
      {
        "rn": "FleetTracker",
        "api": "N-ACME-FleetTracker",
        "rr": false,
        "ty": 2,
        "ri": "6a8c6652f9881c500060df89",
        "aei": "S-ft-munich-001",
        "cr": "S-ft-munich-001",
        "pi": "acme-iot",
        "ct": "20260824T154210,018000",
        "lt": "20260824T154210,018000"
      }
    ]
  }
}
Include the Parent Types
Like every filter, ty must match each resource on the path from the target down to the result (see How filters are combined ). For example, GET $API_URL?rcn=8&ty=3 does not return any Containers, because the AppEntities above them are not of type 3. To get the Containers of all AppEntities, include both types: GET $API_URL?rcn=8&ty=2&ty=3. To get the Containers of one AppEntity, start the search from it: GET $API_URL/WeatherStation?rcn=8&ty=3.

Filter by label (lbl)

Labels (lbl) are tags that you attach to resources when you create or update them, for example "lbl": ["site:berlin"]. With the lbl query parameter you can search for resources by these tags. A value like lbl=site:berlin matches resources that have a label with exactly this key and value. If your labels have no value part, search for the key alone, for example lbl=outdoor.

You can also look for several labels at once, either by repeating the parameter (lbl=site:berlin&lbl=site:munich) or by separating the labels with a space (lbl=site:berlin%20site:munich). A resource only needs one of the labels to be returned.

In the example below, only telemetry and its ContentInstance are returned. The alerts Container is missing because it doesn’t have the site:berlin label. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET \
"$API_URL/WeatherStation?rcn=6&lbl=site:berlin" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-6" \
--header "Accept: application/json"
{
  "m2m:rrl": {
    "rrf": [
      {
        "nm": "telemetry",
        "typ": 3,
        "val": "acme-iot/WeatherStation/telemetry"
      },
      {
        "nm": "reading-001",
        "typ": 4,
        "val": "acme-iot/WeatherStation/telemetry/reading-001"
      }
    ]
  }
}
Label Format Limitations
  • Labels are separated by spaces in the lbl parameter, so labels that contain a space cannot be searched for.
  • Only the part up to the second colon is used for matching. A label with a colon in its value, such as url:https://example.com, cannot be matched exactly.

Filter by attributes

Any resource attribute can be used as a filter by passing its name as a query parameter, for example rn=telemetry for the resource name, or ni=urn:x-dtiot:dev:sn:WS-BERLIN-001 for the node ID of a Node. DMO accepts both the short oneM2M names (rn) and the long names (resourceName). As with the other filters, you can repeat the parameter to allow several values (rn=telemetry&rn=alerts).

This request looks for a Container named telemetry below WeatherStation. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET \
"$API_URL/WeatherStation?rcn=6&ty=3&rn=telemetry" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-7" \
--header "Accept: application/json"
{
  "m2m:rrl": {
    "rrf": [
      {
        "nm": "telemetry",
        "typ": 3,
        "val": "acme-iot/WeatherStation/telemetry"
      }
    ]
  }
}
NOTE
Query parameters that are not a known resource attribute are ignored, so a mistyped attribute name returns unfiltered results instead of an error.

How filters are combined

You can use several filters in one request. The type filter (ty) is always combined with the others using AND, so a resource has to be of one of the requested types and also match the rest. Labels and attribute filters, on the other hand, are combined using OR. For example, lbl=site:berlin&rn=alerts returns resources that either have the site:berlin label or are named alerts.

Keep in mind that the filters are not only checked on the resources you are looking for, but on the whole path leading to them. A resource is only returned if every resource between the target and itself matches the filters too. Once a resource doesn’t match, nothing below it is returned, even if those resources would match on their own.

This is easy to miss when searching from the CSEBase. In the example tree, the routes Container has the site:berlin label, but its parent FleetTracker does not. That’s why the following search does not find routes:

  • Copy & paste
  • Output
curl --location --request GET "$API_URL?rcn=6&lbl=site:berlin" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-8" \
--header "Accept: application/json"
{
  "m2m:rrl": {
    "rrf": [
      {
        "nm": "WeatherStation",
        "typ": 2,
        "val": "acme-iot/WeatherStation"
      },
      {
        "nm": "telemetry",
        "typ": 3,
        "val": "acme-iot/WeatherStation/telemetry"
      },
      {
        "nm": "reading-001",
        "typ": 4,
        "val": "acme-iot/WeatherStation/telemetry/reading-001"
      }
    ]
  }
}

To find routes, start the search one level lower from its parent: GET $API_URL/FleetTracker?rcn=6&lbl=site:berlin. In general, filtered searches work best when you start them from the closest common parent of the resources you need.

Limit the search depth (lvl)

By default, discovery goes through the whole subtree below the target resource. If you don’t need all of it, lvl limits how many levels deep the search goes, counted from the target. With lvl=1 you only get the direct children, lvl=2 adds their children, and so on. The default value -1 means there is no limit.

lvl must be a positive integer or -1. Other values are rejected with HTTP 400 and X-M2M-RSC: 4000.

The request below returns the Containers directly under WeatherStation, but not their ContentInstances. A successful request returns HTTP 200 and X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --request GET "$API_URL/WeatherStation?rcn=6&lvl=1" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-9" \
--header "Accept: application/json"
{
  "m2m:rrl": {
    "rrf": [
      {
        "nm": "alerts",
        "typ": 3,
        "val": "acme-iot/WeatherStation/alerts"
      },
      {
        "nm": "telemetry",
        "typ": 3,
        "val": "acme-iot/WeatherStation/telemetry"
      }
    ]
  }
}

Pagination (limit and offset)

Large discovery results can be split into pages with limit and offset. Both count only the direct children of the target resource. limit sets how many of them are returned, and each returned child still comes with the resources below it. offset sets how many direct children are skipped. Note that offset starts at 0 in DMO, while the oneM2M standard starts counting at 1. Neither parameter can be negative; negative values are rejected with HTTP 400 and X-M2M-RSC: 4000.

You can send either parameter on its own. As soon as one of them is set, the response contains these headers:

HeaderDescription
X-M2M-CTSAlways 1 when pagination was applied.
X-M2M-CTOThe offset to use for the next page (offset + limit).

As long as there are more results, DMO answers with HTTP 206 Partial Content and X-M2M-RSC: 1221. The last page comes back with HTTP 200 and X-M2M-RSC: 2000. If the target resource is a Container, its ContentInstances are paged after its child Containers.

Step 1: Request the first page

With limit=1, only the first AppEntity of the tenant is returned. There is one more AppEntity, so the response is HTTP 206 with X-M2M-RSC: 1221.

  • Copy & paste
  • Output
curl --location --include --request GET \
"$API_URL?rcn=8&ty=2&limit=1" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-10" \
--header "Accept: application/json"
HTTP/1.1 206 Partial Content
X-M2M-RSC: 1221
X-M2M-CTS: 1
X-M2M-CTO: 1
{
  "m2m:cb": {
    "m2m:ae": [
      {
        "rn": "WeatherStation",
        "api": "N-ACME-WeatherStation",
        "rr": false,
        "lbl": [
          "site:berlin"
        ],
        "ty": 2,
        "ri": "6a8c6644f9881c500060df88",
        "aei": "S-ws-berlin-001",
        "cr": "S-ws-berlin-001",
        "pi": "acme-iot",
        "ct": "20260824T154156,484000",
        "lt": "20260824T154653,600000",
        "nl": "6a8c66a7f9881c500060df8b"
      }
    ]
  }
}

Step 2: Request the next page

Take the value of X-M2M-CTO from the previous response and send it as offset. Since this is the last page, the response is HTTP 200 with X-M2M-RSC: 2000.

  • Copy & paste
  • Output
curl --location --include --request GET \
"$API_URL?rcn=8&ty=2&limit=1&offset=1" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-M2M-Origin: S-ws-berlin-001" \
--header "X-M2M-RI: discovery-example-11" \
--header "Accept: application/json"
HTTP/1.1 200 OK
X-M2M-RSC: 2000
X-M2M-CTS: 1
X-M2M-CTO: 2
{
  "m2m:cb": {
    "m2m:ae": [
      {
        "rn": "FleetTracker",
        "api": "N-ACME-FleetTracker",
        "rr": false,
        "ty": 2,
        "ri": "6a8c6652f9881c500060df89",
        "aei": "S-ft-munich-001",
        "cr": "S-ft-munich-001",
        "pi": "acme-iot",
        "ct": "20260824T154210,018000",
        "lt": "20260824T154210,018000"
      }
    ]
  }
}

Long attribute names

All examples on this page use the short oneM2M attribute names such as rn, ty and lbl, which is the default. If you prefer the long names (resourceName, resourceType, labels), add the fullName header to the request. Its value doesn’t matter, because DMO only checks whether the header is there.

Errors

HTTP statusX-M2M-RSCCause
4004000lvl is not a positive integer or -1, or limit or offset is negative.
4044004The target resource doesn’t exist, or, with rcn=1, it doesn’t match the label or attribute filters.
5015001rcn has an unsupported value, or the request uses fu=1 (filter usage “discovery”). Use rcn=4, rcn=6 or rcn=8 for discovery instead.