This manual describes the MQTT interface to Deutsche Telekom’s Cloud of Things. It is aimed at firmware and embedded
developers wishing to implement the interface to Cloud of Things on an IoT device.
A special programming language is not used. In principle, any programming language that has access to the required
libraries is conceivable.
MQTT ( MQ Telemetry Transport or Message Queue Telemetry Transport ) is an open message protocol for machine-to-machine
communication (M2M), which enables the transmission of telemetry data in the form of messages between
devices, despite high delays or limited networks. The appropriate devices range from sensors and actuators, mobile
telephones, embedded systems in vehicles or laptops through to fully-developed computers. The protocol was developed
by “Andy Stanford-Clark” from “IBM” and “Arlen Nipper” from “Cirrus Link Solutions”.
Since 2013, MQTT has been approved as a standard by the Organization for the Advancement of Structured Information
Standards (OASIS) as an Internet of Things protocol. The MQTT protocol is also known under previous names
such as “WebSphere MQTT” (WMQTT), “SCADA protocol” or “MQ Integrator SCADA Device Protocol” (MQIsdp). The
Internet Assigned Numbers Authority (IANA) reserves the Ports 1883 and 8883 for MQTT. MQTT messages can be
encoded with the TLS protocol.
MQTT is a client-server protocol. After establishing a connection, clients send the server (“broker”) messages with a
topic that hierarchically classifies the message; for example, “livingroom/fridge/temperature” or
“car/wheel/3/tirepressure”. Clients can subscribe to topics whereby the server then forwards the received messages
to the corresponding subscribers. In this example, the main topics are “livingroom” and “car”.
Clients can subscribe to topics, and the server then forwards the received messages to the relevant subscribers.
Note: Messages always consist of a topic and the message content.
Messages are sent with a definable quality of service:
at most once (the message is sent once and may not arrive if the connection is interrupted).
at least once (the message is sent until its receipt is confirmed and the recipient may receive it several times)
exactly once (this ensures that the message will only arrive just once, even if the connection is interrupted)
In addition, the retain flag can be used to instruct the server to cache the message on this topic. Clients that are new
subscribers to this topic are the first to receive the cached message.
When establishing a connection, clients can define a “last will” in the form of a message. If the connection to the client
is lost, this message is published and sent to the appropriate subscribers.
MQTT is normally used via TCP and has a 2byte header. The first byte contains the message type (4 bit), the quality of
service (2 bit) and a retain flag.
The following message types exist:
CONNECT
CONNACK
PUBLISH
PUBACK
PUBREC
PUBREL
PUBCOMP
SUBSCRIBE
SUBACK
UNSUBSCRIBE
UNSUBACK
PINGREQ
PINGRESP
DISCONNECT
The second byte contains the length of the rest of the MQTT packet. This is followed by a variable part that contains
the MQTT topic. Finally, the payload arrives, i.e. the data content that is published under the topic.
In case you want to make use of MQTT in an existing or new tenant, it must be set up. To set up your tenant please
contact: cloudofthings@telekom.de.
Broker URL and variants of device registration
The MQTT client - the device - must establish a connection to the Telekom MQTT broker. There is a URL available for
this: nb-iot.ram.m2m.telekom.com.
There are two different variants available to register a device on the Telekom MQTT broker:
device self-registration
bulk registration of devices
Device self-registration means that the device registers itself with the Cloud of Things when it is set up for the first time.
The (bootstrapping-)process of a device self-registration is described in the section “Device self-registration".
The user login data for the normal-level connection is communicated to the device as part of the self-registration process.
Bulk registration of devices means that a list of devices is registered with the Cloud of Things. The device’s individual login
information must be saved on the device when it is manufactured. Further information in section
“Bulk registration of devices”
MQTT Topics
An MQTT device communicates with the Cloud of Things on two prescribed topics, one topic for sending (ms/ICCID) and one
topic for receiving data (mr/ICCID).
topic
state
description
mr/ICCID
normal communication
receiving data (and operations) from Telekom MQTT-Broker
ms/ICCID
normal communication
sending data to Telekom MQTT-Broker
br/ICCID
normal communication binary payload
receiving data (and operations) from Telekom MQTT-Broker
bs/ICCID
normal communication binary payload
sending data to Telekom MQTT-Broker
sr/ICCID
only bootstrapping communication
receiving data while bootstrapping from Telekom MQTT-Broker
ss/ICCID
only bootstrapping communication
sending data while bootstrapping to Telekom Broker
In order to receive data, after successfully connecting to the broker behind the broker URL, the device subscribes to
the topic: mr/ICCID.
ICCID is a placeholder for the own ICCID, which is either determined by the software when accessing the SIM card or
communicated to the software, for example via a configuration file.
For devices without a SIM-card it is necessary to use the MAC-adress of the sending network device.
The device sends data to the CoT via publish commands against the topic: ms/ICCID.
Please note that operations can be lost if you do not use QoS 1.
Please note that the use of “CleanSession=TRUE” can result in missing operations to the device.
MQTT Security Basics
The following MQTT security settings are prescribed or implemented when communicating with the Telekom MQTT
broker:
MQTT via TCP
TLS v1.1/1.2 (Port 8883) on the broker (HiveMQ)
QoS 0, 1 and 2
Clean Session true and false
Last Will not supported
Retained Flag not supported
Wildcard subscribes not permitted
Subscriptions to the publish topics are not permitted (“write-only”)
Topics other than the two previously mentioned are not available due to security reasons and can also not be created
or subscribed by the device.
Device self-registration
Each device must first perform a self-registration (bootstrap). It receives its device credentials and device ID as part of
this self-registration.
First, the device generates a sufficient random and temporary password with 128Bit/16 Byte length. Example: it
initializes the randomizer with the current TIME (seconds since 1970). A random function then generates a password with
128 bits (16 bytes). This is followed by the randomizer generation and executing a sleeptime of 0 to 60 seconds (so
that the TIME cannot be determined from the CONNECT time).
The device connects to CoT with bootstrap user data against the bootstrap URL.
After successful connection, it subscribes to the sr/ICCID topic. ICCID is a placeholder for the own ICCID, which is
either determined by the software when accessing the SIM card or communicated to the software, for example via a
configuration file.
Note: the device is subscribed on topic sr/ and not mr/ as provided for normal communication
The device publishes the random password on the ss/ICCID topic: tempPassword
Note: the device publish the random password on topic ss/ and not ms/ as provided for normal communication
The following information will provide a better understanding of how the bootstrap process works internally.
The bootstrap process queries and retrieves the credentials for the user ICCID from the CoT:
As long as the ICCID has not been entered under device management/device registration in the UI of the platform and
accepted with the Accept button, the bootstrap process will also not be informed of any credentials.
As soon as the ICCID has been accepted in the user interface, the bootstrap process receives the credentials and
sends them encoded to the device using the Extended Tiny Encryption Algorithm: 3rasfst4swfa.
This encoded result is published under the sr/ICCID topic. Since the device is subscribed to this topic, it receives the
encoded payload. Using the random password, the device can now decode the payload.
Please note that the encrypted string will be padded to the nearest multiple of eight. Various encrypted blocks have to
be connected and the pad-bytes have to be removed afterwards.
The device saves the password at a suitable location. Its user name has the following format: ICCID.
As from this point in time, all further connections are made using these credentials via the broker URL.
The bootstrap process can be repeated at any time, for example when moving to a different tenant or after
losing access data. Credentials in the CoT must be deleted manually.
Bulk registration of devices
The bulk registration of devices is used to simplify the registration of a large number of devices. The devices are
provisioned with a username and a password for logging on to the broker URL at the manufacturer during manufacture or
initialization. There are small differences between the registration for just MQTT devices and NB-IoT devices:
To register the devices on the platform, the manufacturer must create a CSV file with the following content
and structure and upload it to the device management of the CoT:
MQTT
The headlines for the MQTT CSV file are:
ID;CREDENTIALS;TYPE;NAME;ICCID;SHELL
The columns are used as follows:
ID: The external id of device
CREDENTIALS: Password that is used by the device for the registration in Cloud of Things.
TYPE: Type of the device. If the device should be connected via MQTT the type “mqtt” have to be used.
NAME: Name of the device for the display within the device management.
ICCID: Is used as the device’s registration name for Cloud of Things.
SHELL: Is a flag (0 or 1) whether to allow the sending of operations to a device or not (1=yes).
A line in the file must be available for every new device to be registered.
Note: The pre-registered devices do not perform self-registration but log in immediately with the pre-provisioned credentials
to the broker URL.
Deleting a device
As part of a device’s life cycle, it may be necessary to delete its credentials and its ManagedObject in the tenant. The
device can establish this by not being able to connect to the broker URLs device credentials it communicated, although this was previously still possible.
In this case, the broker rejects the connection as unauthorized.
Code
message text
4
Connection Refused, bad user name or password
5
Connection Refused, not authorized
It is now the task of the device to perform self-registration again. The exact procedure of self-registration is described
above.
The deletion can be done via the device management of the CoT. Before a new registration, the device access in the CoT
must also be deleted.
SmartRest
General information
Normally, a device uses the Cloud of Things via a REST interface and sends POST, GET and PUT commands with
JSON structures via HTTP to the body (payload). This method is proven and safe, but has the “disadvantage” that a lot
of data must be sent back and forth, thus greatly increasing the transfer volume of the device on the SIM card.
MQTT was developed as a narrowband protocol for the requirements of devices in the Industry 4.0 environment, so it
should keep the data volume to be transmitted as low as possible.
SmartRest was developed since this claim is not compatible with “communicative” REST/JSON. SmartRest is a method
to reduce REST/JSON content to its essential data part and to save overheads in transmission. This occurs through the
agreement between so-called SmartRest templates. A SmartRest template describes how to interpret sent data and
translate it into JSON/REST.
In addition, the device must also define so-called response templates. These templates match to an expected response
of the CoT in JSON/REST format. Here the actual net data from the JSON are extracted and formatted by the platform
on the basis of the response template specification.
A device defines its own set of templates once and addresses this template set via a unique ID. The definition of a
template sentence is called registration. Registration is carried out either by the device itself or by the admin user for all
devices of a certain type.
The device manufacturer must develop and assemble this set of templates individually for the device. He has to decide
if the device will do the template registration first after self-registration or if the admin user has to register the supplied
template collection in advance on the CoT.
A device sends data by specifying which template (unique template ID) it wants to use and then sends the associated
net data as a CSV. It receives a response from the CoT in the form of a response template ID and the corresponding
net response data.
Creating SmartRest templates
In order to communicate with SmartRest, there must always be a collection of pre-registered templates. There are both
request and response templates.
A template collection must be registered in the platform. Registration can also be carried out by the device itself via
MQTT. However, the direct REST interface of the respective tenant is recommended for this since a template collection
for registration must always be sent completely in one command. This would lead to a very large MQTT payload.
Alternatively, of course, the tenant administrator can also register the template collection(s) for the devices on the
platform.
All templates of a device type to be used are summarized in a template collection below a so-called X-ID and registered
in a bundled form. The X-ID is also used to indicate which registered template collection should be used. Template
collections for an X-ID cannot be changed, only deleted and recreated.
A X-ID consists of digits and letters, thus at least one letter must be used. Only numeric X-IDs are not allowed.
Template collections for an X-ID cannot be changed, only deleted and newly created.
Registration of a template collection is carried out by a device itself via MQTT payload or the tenant admin does this by
means of a REST POST:
POST https://tenant.platform/s
The basic Auth is transferred to an HTTP header field. The template collection with the associated X-ID is in the body of
the REST call. The X-ID must be specified in the first line together with the fixed ID 15. All templates to be registered
then follow line by line.
If the device registers the template itself via MQTT, the entire template collection must be transferred to an MQTT
payload. It is essential to first carry out the fixed ID 15 and specification of the X-ID. Thereafter, the individual template
registrations are each separated by a line separator character:
The positive result of the platform after template registration is:
20,Templatesammlung-MO-ID
The template collection has been created in the platform under template collection MO ID.
Changes to a registered template collection are not possible. The template collection can, however, be deleted by
deleting it on the template collection MO ID in the ManagedObjects and then recreating it.
For this purpose, each template collection should contain a template for deleting the collection:
Subsequently, the corrected or supplemented template collection can be re-registered as described above.
Device self-creation
A device must create itself once in the platform after receiving its credentials. To do this, it first logs in to the broker
URL with its username and password.
All further steps are carried out by the publish function of MQTT payload to the ms/ICCID topic. In the payload, the fixed
ID 15 and specification of which X-ID should be addressed always occur at the beginning. This is followed by a line
separator character \n and indication of the template ID to be addressed.
Finally, the transfer parameters are listed, separated by commas.
The device first checks, if there already exists a registration for its ICCID or serial number (hardware replacement). In
the process, it uses, for example, the following template:
The device sends the following message as payload via MQTT:
15,X-ID\nTID,ICCID
Here it is necessary to enter the own serial number. If a registration for this serial number already exists, a response - as
MQTT Publish to the topic mr/ICCID - is received with the following content:
87,1,X-ID\nRTID,2,ICCID,MO-ID
The device should now use this ManagedObject ID as its own MO ID for all further actions.
If there is no registration, an error message
50,2,404,Not Found
is returned via mr/CCID. What that means for the device is that, now it must first create itself as a ManagedObject.
There is a template registration for this describing the MO and its basic properties:
The device sends an MQTT message with the following payload for self-creation in the external IDs:
15,X-ID\nTID,MO-ID,ICCID
Note: without the registration of the ICCID/serial no. in the globalIds the device cannot automatically
receive operations.
The device then updates its ManagedObject by entering device-specific data such as ICCID, IMSI,
software and firmware releases, its type and hardware serial number (see external IDs):
The device sends an MQTT message with the following payload to update the MO:
15,X-ID\nTID,MO-Id
The device now exists on the platform following correct creation and can now send measurements, alarms, etc.
Sending measurements
Once a device has been completely created on the platform, it can begin to send measurements, events, and alarms.
Templates must also be registered in the template collection for these sending processes. Below is an example of a
template for sending a measurement and its use in the MQTT payload.
The timestamp, which indicates the exact point in time of the measurement, is important here.
The first parameter designates the entire measured value as it is then listed in the user interface
of the platform.
The second parameter “0” is the designation for the measured value series or the curve identifier. For example, this
could be used to summarize temperature values from different sensors in a measured value graph and clearly identify
their individual curves.
This is followed by the actual value measured, in this case 395.3. Then the unit, here °C. The timestamp of the
measurement is followed by indication of your own ManagedObject so that the measured value in the platform references
the correct device. Finally, the type of the measured value is given. Fixed platform constants or own constants can be
used here.
The result of the measured value transfer is published to the device as an MQTT message on the mr/ICCID topic.
Sending events
Templates must also be registered in the template collection for sending events. Below is an example of a template for
sending the current geolocation of the device and its use in the MQTT payload.
The first parameter returned here is the X-ID of the template collection. This is followed by a line separator
and then the template ID followed by a timestamp with the time of the event.
After the reference to the own ManagedObject, this is completed by the 3 parameters longitude, altitude and latitude.
In the same way any kind of event can be sent. Events are freely configurable in the platform. Minimal parameters must
however be indicated:
parameter
description
<time>
“2011-09-06T12:03:27.845+02:00”
<type>
EventType
<text>
“free text about the event”
<source>
{ “id” : MO-ID }
Sending alarms
Alarms are events that require particular attention from users or even trigger additional alarm mechanisms such as
SMS dispatch.
Sending alarms also requires prior registration of appropriate templates:
The device sends an alarm by publishing an MQTT message with the appropriate payload on ms/ICCID:
15,X-ID\nTID,Kesseltemperatur,2017-09-14T12:37:00.000,"Kesseltemperatur stark erhoeht",ACTIVE,MAJOR,MO-ID
After specifying the fixed ID 15, the X-ID is specified, followed by a line separator.
After specifying the template ID, the alarm type (boiler temperature) is given, followed by the timestamp of the
alarm time and an alarm text.
Then the alarm status (ACTIVE, ACKNOWLEDGED or CLEARED) and its importance (CRITICAL, MAJOR, MINOR or
WARNING), always in capital letters.
The own ManagedObject ID comes at the end so that the referencing device can be found.
Creating and linking a child device
Devices, particularly gateway devices, can have child devices. A device must create its child devices on the platform
itself and link them to its ManagedObject.
Two templates should be available in the template collection of the device for this purpose.
Template A creates a child device as a ManagedObject on the platform. Please note that the fragment “c8y_IsDevice: {}"
is not set so that the child device is not visible in the device list:
Now the device has to link the MO ID of the child device to its own ManagedObject. To do this, it retrieves template B
with the following payload:
15,X-ID\nTID2,MO-ID,Child-MO-ID
The child device is now linked to the device and can be selected and viewed in the UI of the platform under “Child
Devices”. In addition, further properties of the child device can now be stored and changed on its ManagedObject. It
behaves exactly like a device ManagedObject.
Operations
Operations are instructions that are sent via the platform to a device. The device must interpret the operation, execute it
and report back results or a status. Furthermore, the device can report that an operation is executed by sending an
appropriate status update.
Operations are published to the device via the mr/ICCID topic. Since the device is subscribed to this topic, it
automatically receives new operations.
As soon as an operation is configured for a device it will be sent at the next connection. It is not possible to cancel an
operation once it is drawn up. All drawn up operations will be sent by the next connection to the broker.
The binding prerequisite for each template collection is that a GET template is registered under template ID 500,
which picks up new operations from the platform. The device does not use this template, complete control is provided
by the MQTT Connector.
Note: In the case of various existing template-collections the template with the ID 500 must exist in exact the
same template-collection, which the device during the first action has used. For instance, the check of the
own ICCID/serial no. in the externalIds. It is the same for all response-templates for operations.
Please note that the device cannot receive automated operations if this template is not registered with the ID 500.
Furthermore, the first request must be send with a template from the template collection in which this template is
registered.
In addition, the device establishes which format it expects information on certain operations on the basis of response
templates in its template collection:
The device must now execute the operation - in this case, the shell command “Is -I” and report back any results and the
result status (SUCCESSFUL or FAILED).
Again, template registrations must be defined in the template collection. The following example shows a template
which can be used to report back the result of the above operation and the updated status:
The device publishes an MQTT message with the following payload on the ms/ICCID topic:
15,X-Id\nTID,OP-ID,"SUCCESSFUL","total 28496 -rw-r--r-- 1 user staff 474559 10 Mai 10:08 D-Route5.gpx drwxr-xr-x 6 user staff 192 18 Sep 10:11 Distribute -rw-r--r-- 1 user staff 6959276 8 Aug 11:59 GTEClient.jar","ls -l"
The most important feature for all actions is the OperationID (OP ID), which was transmitted together with the
operation. With the OP ID, operations are clearly referenced on the platform.
Handling of operations for child devices
Operations that are configured for an assigned child device on the platform are also published to the device
with the topic mr/ICCID.
The MO-ID in the response is equal to the MO-ID of the child device.
Hence, the parent device (gateway) has to know the MO-IDs of its assigned child devices to be able to forward
the operations to its child devices. The responses and status updates of the operations must be send or
processed by the parent device to the platform for its child devices.
Retrieve own tenant
If the connected tenant is needed by a self-registered device, for instance for a firmware download via HTTPS
connection, this can be done by two templates:
Through this answer the current tenant can be determined.
Changing hardware
Over the time, there will be hardware changes due to defects. Nevertheless, the already collected data should stay
and should be processes as usual.
This is guaranteed by self-registration of the replacement device or a new registration of a so-called “identity” in
CoT.
The creation of an identity has to be done in the device management application in CoT. Choose “all devices” and
select the appropriate device. In the device menu select the “identity” tab and “add identity.” (E.g.: serial number)
Note that it is necessary to use the same type as of the old identity. Only a new “external_ID” must be created.
The next step is to delete the old device credentials in the tab “device credentials”. Now, the new device starts a
self-registration and it must use the deviceuser/ICCID of the changed device.
New credentials for this user can be created with the SelfReg and the old MO can use these new credentials, it is
just essential that the DeviceUser has the same name.
SMARTREST binary payload
SmartRest messages can also be binary coded to reduce the data volume.
The following MQTT topics are available for this:
topic name
description
bs/ICCID
for sending messages
br/ICCID
for receiving messages
An MQTT binary payload request message has the following structure:
<XID><TID><Payload>
where:
parameter
description
<XID>
the X-ID of the template collection (required field, 0-terminated string)
<TID>
the TID template ID of the template (2 bytes after 0-terminated string)
<Payload>
raw data (dependent on the template)
The raw data consists of values that can have the following data types in accordance with Cloud of Things SmartRest templates:
data type
description
STRING
(0-terminated, encoding: UTF-8)
UNSIGNED
(32-bit unsigned int, byte order: big-endian)
INTEGER
(32-bit signed int, byte order: big-endian)
NUMBER
(32-bit float; byte order: big-endian)
DATE
(32-bit Unix timestamp, to the second; byte order: big-endian)
An MQTT message can consist of multiple MQTT binary payload messages:
A binary coded message defined in this way can be parsed as follows:
At the beginning, the 0-terminated string is extracted and interpreted as <XID>
The <TID> template ID is determined from the next two bytes
Note: in contrast to the normal SmartRest, where the TID can be up to 4 bytes long, binary requests can
only access TIDs up to 65535.
The template collection with <XID> is used to determine and provide Cloud of Things SmartRest template with
<TID>. Based on the sequence of data types defined in Cloud of Things SmartRest template, the next bytes of the
message are converted into the corresponding data types. This data is used to generate a traditional
SmartRest MQTT message.
The generated message is then sent to the Cloud of Things.
If the byte array contains further bytes after parsing the first message, then these are interpreted as
another message and processed in the same way.
In order to use the MQTT binary payload standard efficiently, you should make sure that the STRING data type is
avoided if possible.
Accordingly, Cloud of Things SmartRest request templates should be adapted so that data such as numbers and dates
is assigned to suitable data types and values such as status, measurement data description, and type no longer have to
be transferred as variable data, but are predefined in the template. For example, you could dispense with
transferring the status of an operation by defining a template for each status.
Optimized template for sending the result of a successfully executed operation:
This way, more templates are needed. These templates can also be used to send traditional UTF-8 string encoded
SmartRest MQTT messages.
For better readability, the values in the following message examples are separated by a space. Values of the data
type STRING are enclosed in quotation marks that will not appear in the payload. A date value of type DATE is
displayed as <TS> (=Timestamp, to the second).
An MQTT binary payload message that sends the result of an operation using template ‘(1)’ and sets the status to
“SUCCESSFUL” then looks like this:
Note that the message must, of course, really contain the corresponding byte values. This means: 109, 121, 88, 73,
68, 0, etc., and not the characters “6,” “D,", “7,” etc. in the hexadecimal format. This is only selected here to also
show non-printable bytes.
Binary payloads can be sent, for example, for mosquitto_pub with the parameter –stdin-file/-s:
In addition to Cloud of Things SmartRest error codes listed in the appendix, the following error messages may occur when
processing the MQTT binary payload message.
The error messages use the same format as the Cloud of Things SmartREST error messages and are sent to the device
via the ‘br/ICCID’ topic.
Placeholders in error messages
The following error messages are displayed with placeholders in angle brackets (‘<’ and ‘>’).
When the error message is delivered, these placeholders are filled with concrete values.
The following placeholders are used in error messages:
placeholder
description
<XID>
The X-ID of the referenced template
<Template-ID>
The template ID of the referenced template
<Binary-Message-Index>
A binary payload may contain multiple binary messages. This is the index of the binary message considered when the error occurred. Indexing starts with 1. Contains the value ‘unknown’ if the binary message index is unknown
<Byte-Position>
The number of read bytes when an error occurs. It is not guaranteed that the cause of the error is to be found at exactly this byte position. Contains the value ‘unknown’ if the byte position is unknown
<Parameter-Position>
Position of the parameter (which could not be parsed) in the binary message. Parameter indexing starts with 1
<Parameter-Type>
The expected type of a parameter as defined in Cloud of Things SmartRequest template
Missing X-ID
If the X-ID does not exist in the message or is not 0-terminated:
42 Malformed Request: no X-Id found in binary message '<Binary-MessageIndex>' around byte '<Byte-Position>'
Missing template ID
If the template ID of a message cannot be determined:
42 Malformed Request: no Template ID found in binary message '<BinaryMessage-Index>' around byte '<Byte-Position>'
SmartRequest template not found
If the determined template ID or X-ID cannot be found in the cache:
43 Invalid template identifier: template with X-ID '<X-ID>' and Template ID '<Template-ID>' not found in cache
The cause may be that
the referenced template was not defined in the Cloud of Things tenant
the template has not yet been loaded from the tenant; in this case the problem should disappear after a few
minutes
Invalid parameters
If one of the supplied parameters cannot be parsed correctly:
45 Invalid parameter at position '<Parameter-Position>': Expected type '<Parameter-Type>' in binary message '<Binary-Message-Index>' around byte '<Byte-Position>'
SmartRest Codes
SmartREST Response Codes
On each SmartRest command, the platform sends a result as an MQTT payload to the mr/ICCID topic. The codes are
explained below.
code
description
20
SmartREST Template MO GId
Echo response message. Template was found or has been created and everything is OK.
40
None
Template not found.
41
Line number (optional)
Template creation error.
42
Line number
Malformed request line
43
Line number
Invalid message identifier
45
Line number
Invalid message arguments.
50
Linenumber HTTP response code
Server error. This message occurs when an error happened between Cloud of Things SmartREST proxy and the platform.
87
amount of lines, X-Id
Indicates which X-Id was used to create the amount of following response lines.
SmartRest Error codes
code
message text
41
Cannot create templates for already existing template object
41
Duplicate message identifiers are not allowed
41
Bad request template definition
41
Bad response template definition
41
Bad value type: …
41
Bad pattern
41
Not a valid message identifier for template creation
41
Invalid JsonPath
41
Using JsonPath to refer to a list of objects is not allowed for SmartRest
41
Using Filters (?) in JsonPath is not allowed for SmartRest
41
No content type supported for {GET or DELETE} templates.
41
No template string supported for {GET or DELETE} templates.
41
No content type found for {POST or PUT} templates.
41
No template string found for {POST or PUT} templates.
41
Values are only supported for templates with placeholder.