Documentation

Mistake on this page? Email us

Connect API

Pelion Device Management Connect API allows web applications to communicate with devices. You can subscribe to device resources and read values from and write values to them. Device Management Connect allows connectivity to devices by queueing requests and caching resource values.

Pre-subscriptions and subscriptions are linked to the API key that you use to set the subscriptions. To retrieve, set and remove the subscriptions, you must use the same API key in the subsequent requests.

See Troubleshooting the APIs for information on status and error codes.

Version: 2
Host: https://api.us-east-1.mbedcloud.com

Endpoints

DeviceRequests

post /v2/device-requests/{device-id}
Send an async request to device Show more Show less

This API provides an interface to asynchronously call methods on a device.

The async-id is provided by the REST client, enabling the REST client to track the end-to-end flow with an identifier relevant to the end application. It can be, for example, a UUID or the web application's session ID along with the device ID and the resource. This also prevents any race conditions with the notification channel. All responses are sent through the currently configured notification channel as an AsyncIDResponse.

For GET methods, values may be fetched from an internal cache, instead of contacting the device.

Example: Read the value of Resource "/3200/0/5501". If the value is not in cache, the read command will go all the way to the device.

curl -X POST https://api.us-east-1.mbedcloud.com/v2/device-requests/{device_id}?async-id={async-response-id} \
-H 'Authorization: Bearer {api_key}' \
-H 'content-type: application/json' \
-d '{"method": "GET", "uri": "/3200/0/5501"}'

The server puts the requests in a queue if it cannot reach the device at the time of the request. The queue is limited to 20 requests. The queueing behaviour is affected by the retry and the expiry-seconds parameters. If the device is not reached, or the device fails to respond when the request is made, the server queues the request and retries the delivery within the given expiry period the next time the device contacts the server. The requests from the queue are delivered in the order of insertion, one at a time, and not concurrently.

A delivery attempt follows the protocol-specific retransmission logic. Depending on the protocol, there can be multiple transmissions. For CoAP, the retransmissions have an exponential backoff of 2, 4, 8, 16, and up to 64 seconds, taking in total over 2 minutes. If the device does not respond within this two-minute period, the delivery fails, one retry is used, and the request is put back into the queue so long as the retry count is less than its maximum.

For a queue-mode device, the request delivery is not attempted immediately, but only when the device next time contacts the server.

If retries are exhausted or the expiry time has passed, then the server discards the request and sends an error in AsyncIDResponse. The retries could be exhausted, for example, if the device periodically contacts the server and receives the request from the queue, but then fails to respond back to the server.

On the other hand, the device may lose its network connectivity, and the requests in the queue may expire and get discarded before the device regains connectivity. If the request was delivered to the device, the status code in AsyncIDResponse is 2xx or 4xx, as responded by the device. If the request could not be delivered, the status code generated by the server is 429 or 5xx.

You can write Notification Rules for a resource with PUT command. Please see example of the payload below.

{ "method": "PUT", "uri": "/5/0/1?lt=10&gt=60&pmax=120" }

POST method can be used to either execute or create resource on a LWM2M supporting device. When creating a resource, uri must refer to an object, and payload-b64 must be in LWM2M TLV format, as in the following example.

{ "method": "POST", "uri": "/123", "content-type": "application/vnd.oma.lwm2m+tlv", "payload-b64": "BwHFAnZhbHVl" }
Example URIs:
POST /v2/device-requests/015f2fa34d310000000000010030036c?async-id=123e4567-e89b-12d3-a456-426655440000
POST /v2/device-requests/015f2fa34d310000000000010030036c?async-id=123e4567-e89b-12d3-a456-426655440000&retry=2&expiry-seconds=7200

Example payload to read value from resource /5/0/1:
{ "method": "GET", "uri": "/5/0/1" }

Example payload to set notification rules for resource /5/0/1:
{ "method": "PUT", "uri": "/5/0/1?lt=10&gt=60&pmax=120" }

Example payload to write value "value1" to resource /5/0/1:
{ "method": "PUT", "uri": "/5/0/1?k1=v1&k2=v2", "accept": "text/plain", "content-type": "text/plain", "payload-b64": "dmFsdWUxCg==" }

Example payload to execute LWM2M resource /123/1/1:
{ "method": "POST", "uri": "/123/1/1" }

Immediate response:
202 Accepted

Examples of AsyncIDResponse, delivered via the notification channel:
{ "async-responses": [ { "id": "123e4567-e89b-12d3-a456-426655440000", "status": 200, "payload": "dmFsdWUxCg==", "ct": "text/plain", "max-age": 600 } ] }
{ "async-responses": [ { "id": "123e4567-e89b-12d3-a456-426655440000", "status": 504, "error": "TIMEOUT" } ] }
Path parameters
device-id (required)
Path Parameter — The device ID generated by Device Management.
format: uuid, 32 hexadecimal characters
Consumes
This API call consumes the following media types via the Content-Type request header:
  • application/json
Request body
body DeviceRequest (required)
Body Parameter — Device request to send.
Query parameters
async-id (required)
Query Parameter — The client-generated ID for matching the correct response delivered by notification.
format: 1-40 alphanumeric characters and dashes.
retry (optional)
Query Parameter — The number of attempts to deliver the request to the device after the first delivery attempt. For example, two retries sums up to the total of three delivery attempts. If retries are exhausted, the request is discarded and an error is delivered in the AsyncIDResponse. The default value of retries for a non-queue mode device is 0 and 2 for for a queue-mode device.
minimum: 0
maximum: 10
expiry-seconds (optional)
Query Parameter — The time period during which the delivery is attempted, in seconds. If the device is not reachable within this period, the request is discarded and an error is delivered in the AsyncIDResponse. The default value of expiry seconds for a non-queue mode device is two hours and three days for a queue-mode device.
minimum: 60
maximum: 2592000
Produces
This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
Responses
status description schema
202 Accepted.
400 Bad request. Contains one of the errors RESOURCE_NOT_FOUND, DEVICE_NOT_CONNECTED, MALFORMED_JSON_CONTENT, MALFORMED_ASYNC_ID and QUEUE_IS_FULL String
401 Authentication failure.
404

Contains one of the following errors:

Error message Description
DEVICE_NOT_FOUND The device is not in the device registry. It has either requested for register delete or it has not connected in time and is expired.
URI_PATH_DOES_NOT_EXISTS The device does not have requested resource. Check the resource path is correct.
String

Endpoints

get /v2/endpoints/{device-id}
List the resources on an endpoint. Show more Show less

Retrieves resources cached by Device Management Connect. This call does not formulate a message to the device.

Example:

curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique device ID for an endpoint. The ID must be an exact match. Do not use wildcards.
Return type
Example data
Content-Type: application/json
""
Produces
This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
Responses
status description schema
200 Successful response with an array of resources. ResourceArray
404 Endpoint not found.

Resources

delete /v2/endpoints/{device-id}/{resourcePath}
(DEPRECATED) Delete a resource path. Show more Show less
Deprecation Date:
Expected End of Life:
/v2/endpoints/{device-id}/{resourcePath} is replaced by /v2/device-requests/{device-id}.
Links:

(DEPRECATED) A request to delete a resource path must be handled by both Device Management Client and Device Management Connect.

All resource APIs are asynchronous. These APIs respond only if the device is on and connected to Device Management Connect, and there is an active notification channel.

Example:

curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — The resource URL.
Query parameters
noResp (optional)
Query Parameter

If you make a request with noResp=true, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive at the device, and do not return an async-response-id.

If calls with this parameter enabled succeed, they return with the status code 204 No Content. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code 409 Conflict.

Return type
Example data
Content-Type: application/json
{
  "async-response-id" : "9e3c96b8-c4d7-496a-ab90-cc732b9b560e"
}
Responses
status description schema
202 Accepted. Returns an asynchronous response ID. AsyncID
400 Bad request.
404 Requested endpoint’s resource is not found.
409 Conflict. If noResp=true, the non-confirmable request is not supported by the used protocol.
410 Gone. Endpoint not found.
429 Cannot accept the request at the moment: the queue is full.
502 TCP or TLS connection to endpoint cannot be established.
post /v2/endpoints/{device-id}/{resourcePath}
(DEPRECATED) Execute a function on a Resource or create new Object instance. Show more Show less
Deprecation Date:
Expected End of Life:
/v2/endpoints/{device-id}/{resourcePath} is replaced by /v2/device-requests/{device-id}.
Links:

(DEPRECATED) Execute a function on an existing resource and create a new Object instance on the device. The resource path does not have to exist; you can set it with the call. The maximum length of the resource path is 255 characters.

All resource APIs are asynchronous. These APIs respond only if the device is on and connected to Device Management Connect, and there is an active notification channel.

Supported content types depend on the device and its resource. Device Management translates HTTP to the equivalent CoAP content type.

Example:

This example resets the min and max values of the temperature sensor instance 0 by executing Resource 5605 'Reset Min and Max Measured Values'.

curl -X POST https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3303/0/5605 \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — The resource URL.
Consumes
This API call consumes the following media types via the Content-Type request header:
  • text/plain
  • application/xml
  • application/octet-stream
  • application/exi
  • application/json
  • application/link-format
  • application/senml+json
  • application/nanoservice-tlv
  • application/vnd.oma.lwm2m+text
  • application/vnd.oma.lwm2m+opaq
  • application/vnd.oma.lwm2m+tlv
  • application/vnd.oma.lwm2m+json
Request body
resourceFunction string (optional)
Body Parameter — This value is not needed. Most of the time, resources do not accept a function but they have their own functions predefined. You can use this to trigger them. If a function is included, the body of this request is passed as a char* to the function in Device Management Client.
Query parameters
noResp (optional)
Query Parameter

If you make a request with noResp=true, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id.

If calls with this parameter enabled succeed, they return with the status code 204 No Content. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code 409 Conflict.

Return type
Example data
Content-Type: application/json
{
  "async-response-id" : "9e3c96b8-c4d7-496a-ab90-cc732b9b560e"
}
Responses
status description schema
202 Accepted. Returns an asynchronous response ID. AsyncID
400 Bad request.
404 Requested endpoint’s resource not found.
409 Conflict. If noResp=true, the non-confirmable request is not supported by the used protocol.
410 Gone. Endpoint not found.
429 Cannot accept the request at the moment: the queue is full.
502 TCP or TLS connection to endpoint cannot be established.
get /v2/endpoints/{device-id}/{resourcePath}
(DEPRECATED) Read from a resource. Show more Show less
Deprecation Date:
Expected End of Life:
/v2/endpoints/{device-id}/{resourcePath} is replaced by /v2/device-requests/{device-id}. The /v2/device-requests/{device-id} endpoint lets you use your own async-id, and simplifies integration by returning all resource values, cached and non-cached, through the event notification channel.
Links:

(DEPRECATED) Requests the resource value either from the device or cache. If the value is not in the cache, the request goes all the way to the device. When the response is available, an AsyncIDResponse JSON object is received in the notification channel. The resource values can be also in cache based on max_age defined by the device side. The value found from the cache is returned immediately in the response.

The preferred way to get resource values is to use the subscribe and callback methods.

All resource APIs are asynchronous. These APIs only respond if the device is on and connected to Device Management.

See also how resource caching works.

Please refer to Lightweight Machine to Machine Technical specification for more inforamtion.

Example:

curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — Unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — The resource URL.
Query parameters
cacheOnly (optional)
Query Parameter — If true, the response comes only from the cache. Default: false. Device Management Connect caches the received resource values for the time of max_age defined in the client side.
noResp (optional)
Query Parameter

If a request is made with noResp=true, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive on the device, and no async-response-id returns.

Successful calls return with the status code 204 No Content. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code 409 Conflict.

Responses
status description schema
200 Resource value found in cache. Returns the string value of the resource.
202 Accepted. Returns an asynchronous response ID. AsyncID
205 No cache available for resource.
400 Bad request.
404 Requested endpoint’s resource is not found.
409 Conflict. If noResp=true, the non-confirmable request is not supported by the used protocol.
410 Gone. Endpoint not found.
429 Cannot accept the request at the moment: the queue is full.
502 TCP or TLS connection to endpoint cannot be established.
put /v2/endpoints/{device-id}/{resourcePath}
(DEPRECATED) Write to a Resource or use write-attributes (notification rules) for a Resource. Show more Show less
Deprecation Date:
Expected End of Life:
/v2/endpoints/{device-id}/{resourcePath} is replaced by /v2/device-requests/{device-id}.
Links:

(DEPRECATED) With this API, you can write a new value to existing Resources or use the write attribute to set notification rules for the Resources. The notification rules only work on the device client side and may not be supported by all clients.

This API can also be used to transfer files to the device. Device Management Connect LwM2M server implements Option 1 from RFC7959. The maximum block size is 1024 bytes. Note block size versus transferred file size in low-quality networks. The customer application needs to know what type of file is transferred (for example, TXT) and the customer can encrypt the payload. The maximum payload size is 1048576 bytes.

All resource APIs are asynchronous. These APIs respond only if the device is on and connected to Device Management Connect, and there is an active notification channel.

Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type.

Example:

This example sets the alarm on a buzzer. The command writes the Buzzer instance 0, "On/Off" boolean resource to '1'.

curl -X PUT https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3338/0/5850 \
-H "content-type: text/plain" \
-H 'Authorization: Bearer <api_key>' \
-d '1'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — Resource URL.
Consumes
This API call consumes the following media types via the Content-Type request header:
  • text/plain
  • application/xml
  • application/octet-stream
  • application/exi
  • application/json
  • application/link-format
  • application/senml+json
  • application/nanoservice-tlv
  • application/vnd.oma.lwm2m+text
  • application/vnd.oma.lwm2m+opaq
  • application/vnd.oma.lwm2m+tlv
  • application/vnd.oma.lwm2m+json
Request body
resourceValue string (required)
Body Parameter — The value to set to the resource.
Query parameters
noResp (optional)
Query Parameter

If you make a request with noResp=true, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive to the device, and do not return an async_response_id.

If a call with this parameter enabled succeeds, it return status code 204 No Content. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code 409 Conflict.

Return type
Example data
Content-Type: application/json
{
  "async-response-id" : "9e3c96b8-c4d7-496a-ab90-cc732b9b560e"
}
Responses
status description schema
202 Accepted. Returns an asynchronous response ID. AsyncID
400 Bad request.
409 'Conflict. If noResp=true, the non-confirmable request is not supported by the used protocol.'
410 Gone. Endpoint not found.
429 Cannot accept the request at the moment: the queue is full.
502 TCP or TLS connection to endpoint cannot be established.

Subscriptions

put /v2/subscriptions/{device-id}/{resourcePath}
Subscribe to a resource path. Show more Show less

The Device Management Connect eventing model consists of observable Resources.

This means that endpoints can deliver updated resource content, periodically or with a more sophisticated solution-dependent logic. The OMA LwM2M resource model also supports including objects, object instances, resources, and resource instances.

Applications can subscribe to objects, object instances or individual resources to make the device provide value change notifications to Device Management Connect service. An application needs to call a /notification/callback method to get Device Management Connect to push notifications of the resource changes.

Notification rules

A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in Notification rules.

All manual subscriptions are removed during a full device registration, at which point applications must re-subscribe. To avoid this, you can use /subscriptions to set a pre-subscription.

Example:

curl -X PUT https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — The resource URL.
Produces
This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
Responses
status description schema
200 Successfully subscribed.
202 Accepted. Returns an asynchronous response ID used to reference the future asynchronous response. AsyncID
400 Bad request, malformed content.
404 Endpoint or its resource not found.
429 Cannot accept the request at the moment: the queue is full.
502 Subscription failed: endpoint not connected.
get /v2/subscriptions/{device-id}/{resourcePath}
Read subscription status Show more Show less
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — The resource URL.
Responses
status description schema
200 Resource is subscribed.
404 Resource is not subscribed.
delete /v2/subscriptions/{device-id}
Delete subscriptions from an endpoint. Show more Show less

Deletes all resource subscriptions in a single endpoint.

Example:

curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
Responses
status description schema
204 Successfully removed.
delete /v2/subscriptions
Remove pre-subscriptions. Show more Show less

Removes pre-subscriptions.

Example:

curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions \
-H 'Authorization: Bearer <api_key>'
Responses
status description schema
204 Successfully removed subscriptions.
401 Unauthorized.
403 Forbidden: the authorization token used is not an API key.
delete /v2/subscriptions/{device-id}/{resourcePath}
Remove a subscription. Show more Show less

Remove an existing subscription from a resource path.

Example:

curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
resourcePath (required)
Path Parameter — The resource URL.
Responses
status description schema
204 Successfully removed subscription.
get /v2/subscriptions/{device-id}
Read endpoints subscriptions Show more Show less

Lists all subscribed resources from a single endpoint.

Example:

curl -X GET https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \
-H 'Authorization: Bearer <api_key>'
Path parameters
device-id (required)
Path Parameter — A unique Device Management device ID for the endpoint. The ID must be an exact match. Do not use wildcards.
Return type
String
Example data
Content-Type:
Produces
This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • text/uri-list
Responses
status description schema
200 List of subscribed resources. String
404 Endpoint not found, or there are no subscriptions for that endpoint.
get /v2/subscriptions
Get pre-subscriptions. Show more Show less

Retrieve pre-subscription data. The server returns a JSON structure. If there are no pre-subscribed resources, it returns an empty array.

Example:

curl -X GET https://api.us-east-1.mbedcloud.com/v2/subscriptions \
-H 'Authorization: Bearer <api_key>'
Return type
Example data
Content-Type: application/json
""
Produces
This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
Responses
status description schema
200 OK. PresubscriptionArray
401 Unauthorized.
403 Forbidden: the authorization token used is not an API key.
put /v2/subscriptions
Set pre-subscriptions Show more Show less

Pre-subscription is a set of rules and patterns established by the application. When an endpoint registers and its ID, type, and registered resources match the pre-subscription data, Device Management Connect automatically sends subscription requests to the device. The pattern may include the endpoint ID (optionally having an * character at the end), endpoint type, a list of resources, or expressions with an * character at the end. Subscriptions based on pre-subscriptions are done when device registers or does a register update. To remove the pre-subscription data, put an empty array as a rule.

Note: The subscription is bound to the API key your application is using. To get notifications of the resource value changes, you need to create an event notification channel with the same API Key.

For more information, see Subscribing to Resource changes from a web application.

Notification rules

A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in Notification rules.

Limits:

  • The maximum length of the endpoint name and endpoint type is 64 characters.
  • The maximum length of the resource path is 128 characters.
  • You can listen to 256 separate resource paths.
  • The maximum number of pre-subscription entries is 1024.

Example request:

curl -X PUT https://api.us-east-1.mbedcloud.com/v2/subscriptions \
-H 'Authorization: Bearer <api_key>' \
-H 'content-type: application/json' \
-d '[
       {
         "endpoint-name": "node-001",
         "resource-path": ["/dev"]
       },
       {
         "endpoint-type": "Light",
         "resource-path": ["/sen/*"]
       },
       {
         "endpoint-name": "node*"
       },
       {
         "endpoint-type": "Sensor"
       },
       {
         "resource-path": ["/dev/temp","/dev/hum"]
       }
    ]'
  • Subscribe to /dev resource of endpoint named node-001.
  • Subscribe to Light type of endpoints and their resources prefixed with /sen/.
  • Subscribe to all observable resources of endpoint names prefixed with node.
  • Subscribe to all observable resources of Sensor type endpoints.
  • Subscribe to /dev/temp and /dev/hum resources of all endpoints.

Note: To save bandwidth and avoid unnecessary traffic, use resource path patterns to limit the matching resources in the presubscription data. This prevents the notification flow from unwanted resources to your web application. See Subscribe only to what you need.

Consumes
This API call consumes the following media types via the Content-Type request header:
  • application/json
Request body
presubsription PresubscriptionArray (required)
Body Parameter — Array of pre-subscriptions.
Produces
This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • text/plain
Responses
status description schema
204 Successfully created.
400 Bad request, malformed content.
401 Unauthorized.
403 Forbidden: the authorization token used is not an API key.

Models

AsyncID

async-response-id (optional)
String

Asynchronous response unique ID.

AsyncIDResponse

id (optional)
String

The unique ID of the asynchronous response.

status (optional)
Integer

States whether sending a command to the device succeeded or failed.

Code Description
200 Operation succeeded. The payload contains result of the operation from the device.
400 The device rejected the request, possibly because it does not support the request method. See how the supported methods are [configured for the device resources](../connecting/collecting-resources.html#setting-the-operation-mode).
404 The device replied that it does not have the requested resource.
412 Precondition failed and the operation was not executed. The device responded with 4.12 CoAP response code. The device may reject a subscription request with this response code.
413 Request entity is too large and could not be delivered to the device.
415 The device does not support the media type in the request.
429 An expired request was removed from queue (REQUEST_EXPIRED), the device requested deregistration (DEVICE_REMOVED_REGISTRATION), or the device was suspended (DEVICE_BLOCKED). The request was never delivered to the device.
502 The request to the device failed and the retry count was exceeded. The last retry failed to establish TCP or TLS connection to the device.
503 The request to the device failed and the retry count was exceeded. The last retry failed, because the device is currently unavailable (NOT_CONNECTED).
504 The request to the device failed and the retry count was exceeded. The last retry failed, because the device did not respond in time according to the protocol-specific retransmission logic (TIMEOUT).

error (optional)
String

An optional error message describing the error. Please refer to status listing above.

payload (optional)
String

Requested data, base64 encoded.

ct (optional)
String

The content type.

max-age (optional)
String

Determines how long this value stays valid in the cache, in seconds. 0 means that the value is not stored in the cache.

DeviceRequest

method
String

The CoAP request method. Allowed values are GET, POST, PUT and DELETE.

uri
String

The URI path of the requested resource.

accept (optional)
String

The content type of an accepted response.

content-type (optional)
String

The content type of the payload.

payload-b64 (optional)
String

The base64 encoded payload to send to the device.

Presubscription

endpoint-name (optional)
String

The device ID.

endpoint-type (optional)
resource-path (optional)

PresubscriptionArray

Resource

uri
String

The resource URL.

rt (optional)
String

Application-specific resource type that describes this resource. It is created by the client side application. Not meant to be a human-readable name for the resource. Multiple resource types may be included, separated by a space.

obs (optional)
Boolean

'Determines whether you can subscribe to changes for this resource. It can have values true or false.'

type (optional)
String

The content type of the resource.

We recommend you use the resource types listed in the LwM2M specification.

ResourceArray

ResourcePath

A resource URI.

SubscriptionsList

A list of resource URIs, one per line.