Internet ✨
If your device does not support one of our integrated connectivity forms, like LoRa or M2M, you can connect your device directly to KPN Things over the Internet.

Device registration

Our KPN Things Portal documentation explains registering your M2M device in detail. Click the page link below to learn more:
Internet devices
KPN Things Portal

HTTPS

Internet-connected devices can send their data using HTTPS.

The request

Base URL: https://prod.dm.kpnthings.com
POST /ingestion/ip/senml/v1 HTTP/1.1
Things-Message-Token: <messageToken>
Content-Length: <nrBytes>
[{"bn":"urn:dev:DVNUUID:<dvnuuid>:","bt":<timestamp>},<measurements>]

Body

The body of the HTTP request should be a valid SenML pack. For more information see the SenML concept page.

Base time

The base time bt in the SenML pack is optional, because not all devices keep track of the absolute time. If Things Data Management receives a message without base time, the moment that the message is received will be filled in as base time.

Things Message token

For device authentication we introduce a pre-shared secret for each device. This secret is used by the device to generate message tokens that are SHA256-hashes which are send in the Things-Message-Token header of the request. This token can be used by Things to validate the source of the message. At the same time it prevents tampering with the measurement values.
The secret should be at least 30 characters long and no more then 100, is case sensitive and can contain all ASCII characters: ^[0-9a-zA-Z]{30,100}$
The pre-shared secret is used directly for message token calculation. There is no challenge protocol or no session keys, because we rely on the secure channel for complete integrity.
The message token is calculated as following:
messageToken = sha256({requestBody}{sharedSecret})
The requestBody used for the hash should be identical as the body send in the HTTPS request. Preferably strip the from all white space characters before putting it in the hash and the HTTPS request.

The response

When you send data to KPN Things using a HTTP request, the HTTP response is used to transmit a possible downlink message to your device. Only if a downlink message is in status Executing it will be send, and only one downlink message is send at a time.
A downlink message will be structured as SenML in JSON format. Learn more about downlink communication.

Response code

Using the HTTP response code you can debug some common problems:
Code
Description
202
🟢 The message was received and accepted for further processing.
400
🔴 The received message was not correctly structured.
Check whether all required headers are present and whether the request body is correctly formatted.
401
🔴 The Things Message Token could not be verified.
Check the shared secret and the hashing method in your device.
404
🔴 The provided device identifier was not recognized. Check whether the identifier is correct and known in the Things Portal.

MQTTS

To be announced
Copy link
On this page
Device registration
HTTPS
The request
The response
MQTTS