This api provides both module operations as well as stored data access through unified model.
Check the Iot model definition for more information about data made available throught the IoT API.


Device Access requires custom header for authentication check.

Header Description
X-Snsr-Device-Key your device token received upon authentication, see Device authentication for more info



GET /iot/devices/crc.json


Description
Device Authentication operation
Url
https://sensor.insgroup.fr/iot/devices/crc.json
Method
GET
Parameters
  1. sn required The module serial number
  2. key required Key information appears either next to module sn information on product packaging sticker (8 hexa chars, case insentitive), either as a PAC sn given by your module provider (16 hexa chars, case insentitive).
Returns
Device token for use with corresponding header token

Sample JSON response

QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Return value definitions
Field Description
token Base64 encoded token, to store and use for next indiviudal remote Device WS resources
Errors
  • 404 - The serial number was not found
  • 401 - The authentication information are missing or invalid

POST /iot/devices/pacs.csv


Description
Get your module PAC serial number
Url
https://sensor.insgroup.fr/iot/devices/pacs.csv
Method
POST
Returns
A text/plain stream with your device's PAC number.

Sample response :

SERIAL; PAC
1FA0; 5D467EB830D4C820
                        
Errors
  • 401 - The authentication token is invalid or missing

GET /iot/devices/msgs/history.json


Description
Device Messages history resolution
Url
https://sensor.insgroup.fr/iot/devices/msgs/history.json
Method
GET
Parameters
  1. amount optional the amount of event instance to be retrieved, default to 20
  2. until optional the date (GMT timestamp) as end date, default to now
Returns
Information about last

Sample JSON response

[
    {
        "contrib": {
            "temp": "LOW"
        }, 
        "ctxt": {
            "active": true, 
            "alerts": 0, 
            "alerts_ack": 0, 
            "battery": "UNKNOWN", 
            "firstseen": "Mar 25, 2013 2:35:36 PM", 
            "id": "125010855", 
            "index": 6, 
            "lastseen": "Mar 25, 2013 2:35:32 PM", 
            "level": "UNKNOWN", 
            "losts": 0, 
            "msgs": 0, 
            "network": "UNKNOWN", 
            "serial": "1FA0/6", 
            "status": "UNDEFINED", 
            "tamper": "UNKNOWN", 
            "temp": "LOW", 
            "type": "OTHER", 
            "watched": false
        }, 
        "extra": {}, 
        "lvl": "34.49", 
        "station": "003B", 
        "type": "event:templow", 
        "when": 1364222132034
    }, 
    {
        "contrib": {
            "level": "ON"
        }, 
        "ctxt": {
            "active": true, 
            "alerts": 0, 
            "alerts_ack": 0, 
            "battery": "ON", 
            "firstseen": "Mar 25, 2013 2:28:43 PM", 
            "id": "125010772", 
            "index": 4, 
            "lastseen": "Mar 25, 2013 2:29:43 PM", 
            "level": "ON", 
            "losts": 0, 
            "msgs": 1, 
            "network": "UNKNOWN", 
            "serial": "1FA0/4", 
            "status": "UNDEFINED", 
            "tamper": "UNKNOWN", 
            "temp": "UNKNOWN", 
            "type": "OTHER", 
            "watched": false
        }, 
        "extra": {}, 
        "lvl": "34.47", 
        "station": "003B", 
        "type": "event:rssiok", 
        "when": 1364221783996
    }
]

                             
Return value definitions
Field Description
when Message reception timestamp (GMT)
lvl Signal level upon reception
station Receiver station id
extra Additional infos
type Frame type
contrib Device Field with corresponding value provided by the frame
ctxt Device context at the time of frame reception

More information about message structure available Here

Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing

GET /iot/devices/msgs/recents.json


Description
Device Messages history resolution
Url
https://sensor.insgroup.fr/iot/devices/msgs/recents.json
Method
GET
Parameters
  1. amount optional the amount of event instance to be retrieved, default to 20
  2. after optional the date (GMT timestamp) as end date, default to now
Returns
Array of iot messages

Sample JSON response

[
    {
        "contrib": {
            "temp": "LOW"
        }, 
        "ctxt": {
            "active": true, 
            "alerts": 0, 
            "alerts_ack": 0, 
            "battery": "UNKNOWN", 
            "firstseen": "Mar 25, 2013 2:35:36 PM", 
            "id": "125010855", 
            "index": 6, 
            "lastseen": "Mar 25, 2013 2:35:32 PM", 
            "level": "UNKNOWN", 
            "losts": 0, 
            "msgs": 0, 
            "network": "UNKNOWN", 
            "serial": "1FA0/6", 
            "status": "UNDEFINED", 
            "tamper": "UNKNOWN", 
            "temp": "LOW", 
            "type": "OTHER", 
            "watched": false
        }, 
        "extra": {}, 
        "lvl": "34.49", 
        "station": "003B", 
        "type": "event:templow", 
        "when": 1364222132034
    }
]
                                     
Return value definitions
Field Description
when Message reception timestamp (GMT)
lvl Signal level upon reception
station Receiver station id
extra Additional infos
type Frame type
contrib Device Field with corresponding value provided by the frame
ctxt Device context at the time of frame reception

More information about message structure available Here

Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing

GET /iot/devices/msgs/sfx/history.json


Description
Device Raw Messages history resolution
Url
https://sensor.insgroup.fr/iot/devices/msgs/sfx/history.json
Method
GET
Parameters
  1. limit optional the limit of raw messages to be retrieved, default to 20
  2. before optional the date (GMT timestamp) as end date, default to now
Returns
Raw messages history

Sample JSON response

[
  {
    "device": "0A03",
    "time": 1447666420,
    "data": "82040002010b",
    "snr": "21.52",
    "rinfos": [
      {
        "tap": "0DCA",
        "snr": "21.52",
        "rssi": "-94.00"
      },
      {
        "tap": "0AF7",
        "snr": "20.15",
        "rssi": "-124.00"
      }
    ]
  },
  {
    "device": "0A03",
    "time": 1447666300,
    "data": "81040002010b",
    "snr": "23.05",
    "rinfos": [
      {
        "tap": "0AF7",
        "snr": "17.40",
        "rssi": "-125.00"
      },
      {
        "tap": "0DD3",
        "snr": "21.86",
        "rssi": "-114.00"
      }
    ]
  }
]

                                 
Return value definitions
Field Description
device Device id
time Message reception timestamp (GMT)
data Raw message
snr The best SNR of the messages received by the network so far
rinfos List all receptions for each base stations
rinfos.tap Base station identifier
rinfos.snr The best signal of all repetitions for this base station
rinfos.rssi Received Signal Strength Indication (in dBm)
Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing

GET /iot/devices/children.json


Description
Module devices resolution
Url
https://sensor.insgroup.fr/iot/devices/children.json
Method
GET
Returns
Array of iot devices registered behind a gw module

Sample JSON response

[
    {
        "active": true, 
        "alerts": 0, 
        "alerts_ack": 0, 
        "battery": "UNKNOWN", 
        "category": "4321", 
        "firstseen": "Mar 22, 2013 8:52:41 AM", 
        "id": "124953171", 
        "index": 2, 
        "lastseen": "Mar 25, 2013 2:25:12 PM", 
        "level": "UNKNOWN", 
        "losts": 192, 
        "msgs": 20, 
        "network": "ON", 
        "serial": "1FA0/2", 
        "status": "UNDEFINED", 
        "tamper": "UNKNOWN", 
        "temp": "UNKNOWN", 
        "type": "OTHER", 
        "uid": "00004321", 
        "watched": false
    }, 
    {
        "active": true, 
        "alerts": 0, 
        "alerts_ack": 0, 
        "battery": "ON", 
        "category": "1001", 
        "firstseen": "Mar 22, 2013 8:53:19 AM", 
        "id": "124953184", 
        "index": 0, 
        "lastseen": "Mar 25, 2013 2:23:52 PM", 
        "level": "UNKNOWN", 
        "losts": 192, 
        "msgs": 20, 
        "network": "UNKNOWN", 
        "serial": "1FA0/0", 
        "status": "UNDEFINED", 
        "tamper": "UNKNOWN", 
        "temp": "UNKNOWN", 
        "type": "OTHER", 
        "uid": "00000001", 
        "watched": false
    }, 
    {
        "active": true, 
        "alerts": 0, 
        "alerts_ack": 0, 
        "battery": "OFF", 
        "firstseen": "Mar 22, 2013 8:54:08 AM", 
        "id": "124953210", 
        "index": 1, 
        "lastseen": "Mar 25, 2013 2:28:10 PM", 
        "level": "UNKNOWN", 
        "losts": 192, 
        "msgs": 20, 
        "network": "UNKNOWN", 
        "serial": "1FA0/1", 
        "status": "UNDEFINED", 
        "tamper": "OFF", 
        "temp": "UNKNOWN", 
        "type": "OTHER", 
        "watched": false
    }, 
    {
        "active": true, 
        "alerts": 0, 
        "alerts_ack": 0, 
        "battery": "UNKNOWN", 
        "category": "1001", 
        "firstseen": "Mar 22, 2013 1:49:53 PM", 
        "id": "124955666", 
        "index": 3, 
        "lastseen": "Mar 22, 2013 1:49:49 PM", 
        "level": "UNKNOWN", 
        "losts": 192, 
        "msgs": 20, 
        "network": "UNKNOWN", 
        "serial": "1FA0/3", 
        "status": "UNDEFINED", 
        "tamper": "UNKNOWN", 
        "temp": "UNKNOWN", 
        "type": "OTHER", 
        "uid": "00000001", 
        "watched": false
    }, 
    {
        "active": true, 
        "alerts": 0, 
        "alerts_ack": 0, 
        "battery": "ON", 
        "firstseen": "Mar 25, 2013 2:28:43 PM", 
        "id": "125010772", 
        "index": 4, 
        "lastseen": "Mar 25, 2013 2:29:43 PM", 
        "level": "ON", 
        "losts": 192, 
        "msgs": 20, 
        "network": "UNKNOWN", 
        "serial": "1FA0/4", 
        "status": "UNDEFINED", 
        "tamper": "UNKNOWN", 
        "temp": "UNKNOWN", 
        "type": "OTHER", 
        "watched": false
    }, 
    {
        "active": true, 
        "alerts": 0, 
        "alerts_ack": 0, 
        "battery": "UNKNOWN", 
        "firstseen": "Mar 25, 2013 2:35:36 PM", 
        "id": "125010855", 
        "index": 6, 
        "lastseen": "Mar 25, 2013 2:35:32 PM", 
        "level": "UNKNOWN", 
        "losts": 192, 
        "msgs": 20, 
        "network": "UNKNOWN", 
        "serial": "1FA0/6", 
        "status": "UNDEFINED", 
        "tamper": "UNKNOWN", 
        "temp": "LOW", 
        "type": "OTHER", 
        "watched": false
    }
]
                                     
Return value definitions
Field Description
when Message reception timestamp (GMT)
raw Raw Message content
hr Human readable translation of the raw content
lvl Signal level upon reception
station Receiver station id
Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing

POST /iot/devices/clear.json


Description
Clear ALL your module's messages
Url
https://sensor.insgroup.fr/iot/devices/clear.json
Method
POST
Returns
void
Errors
  • 401 - The authentication token is invalid or missing

POST /iot/devices/status.json


Description
Changing device functional status
Url
https://sensor.insgroup.fr/iot/devices/status.json
Method
POST
Parameters
  1. id required The device id
  2. sn Device serial number
  3. value required The new state value
Returns
void
Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing

POST /iot/devices/active.json


Description
Toggle device active flag
Url
https://sensor.insgroup.fr/iot/devices/active.json
Method
POST
Parameters
  1. id required The device id
  2. sn required Device serial number
  3. value required The new active flag value
Returns
void
Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing

POST /iot/devices/watch.json


Description
Toggle device monitoring flag
Url
https://sensor.insgroup.fr/iot/devices/watch.json
Method
POST
Parameters
  1. id required The device id
  2. sn required Device serial number
  3. value required The new active flag value
Returns
void
Errors
  • 401 - The authentication token is invalid or missing

POST /iot/devices/bidirval.json


Description
Change device bidir value
Url
https://sensor.insgroup.fr/iot/devices/bidirval.json
Method
POST
Parameters
  1. id required The device id
  2. sn required The device serial number
  3. value required The new bidir value
Returns
void
Errors
  • 404 - The serial number was not found
  • 401 - The authentication token is invalid or missing