CoAP API
The following API is subject to change.
The myDevices Constrained Application Protocol (CoAP) endpoint provides an additional connectivity to send device to cloud messages using the CoAP protocol. This endpoint is ideal for NarrowBand (NB-IoT) and LTE CAT M1 devices.
At this time, the endpoint only offers a very basic functionality to publish messages to a generic path using JSON format. We'll be working to support additional payload type, such as Protobuf and native publish/subscribe features.
Method
Method | URI | Name | Summary |
---|---|---|---|
POST | coap://coap.m2c.io/api/v1/uplink | Device Uplink | Sends telemetry data |
Custom JSON Payload
{
"key": "",
"eui": "UNIQUE_DEVICE_ID",
"format": "json",
"data": {
"temp": 20
}
}
JSON Example Using Cayenne LPP
{
"eui": "UNIQUE_DEVICE_ID",
"format": "hex",
"data": "0367014a046882"
}
Example Using MQTT API Payload
{
"eui": "UNIQUE_DEVICE_ID",
"format": "json",
"data": [
{
"channel": 1,
"value": 16.4,
"type": "temp",
"unit": "c"
},
{
"channel": 2,
"value": 75,
"type": "rel_hum",
"unit": "p"
},
{
"channel": 5,
"value": 75,
"type": "batt",
"unit": "v"
},
{
"channel": 10,
"value": 1,
"type": "digital_sensor",
"unit": "d"
},
{...}
]
}
The data property must be a JSON array of objects, each element having channel
, value
, type
and unit
porperties. Refer to the list of our
supported data types for the type
and unit
properties.