Migrating from V2

The current version of the N2N-DL APIs is 3.

The previous production ready version is version 2 and this guide highlights the main differences between the 2 versions and how to migrate to version 3 painlessly. c

Main differences between V2 and V3

The main differences between N2N-DL V2 and V3 are as follows

  • In V2 payload decoding was required and the original raw payload was discarded
  • Also the device data (readings) and network metadata were stored separately

In N2N-DL V3 the main data entity is called Message.

Every Message contains:

  • a timestamp
  • the raw payload
  • a list of ParserReadings if a built in decoder OR a custom decoder is provided
  • network metadata

Custom decoders

N2N-DL V3 Core APIs support custom decoders on top of built in ones.

ParserReadings

The main reading data structure (ParserReading) is consistent across V2 and V3.

Migrating from V2 to V3

Migration from V2 to V3 requires the following changes:

Only 1 simpler API (Core V3)

Readings APIs, Push APIs and Network APIs have been replaced by 1 single API: Core V3.

Device enrolment and unenrolment from N2N-DL

The Core APIs V3 support direct device enrolment and unenrolment and multiple network servers

Data subscriptions

  • Data subscriptions to the Readings APIs need to be replaced to data subscriptions to the Core APIs
  • Data subscriptions on the Network APIs are no longer needed as Core APIs subscriptions cover network metadata as well as raw payloads and parser readings
  • CSV Push support is currently disabled, only JSON is allowed
  • CSV PULL support (specifically for Eagle.io) is instead available

Devices, API keys, Users, Enterprise and Groups

Devices, API keys, Users, Enterprise and Groups are automatically synchronised from V2 every 10 minutes.

Therefore there is no need to migrate any of these entities manually

Old readings and network metadata

Old readings and network metadata stored in the Readings APIs v2 and the Network APIs v2 are not automatically transferred because of a format mismatch.