Sense i Solutions Ltd · Christchurch, NZ

SenseiQ API Portal Guide

A reference for remote systems interrogating the SenseiQ ecosystem — retrieving event, recording, test, and heartbeat data via HTTP.

REST-likeJSONHTTP POST

Overview

This document is the definitive guide to the API web portal used by external systems to access data from the SenseiQ system.

The SenseiQ ecosystem is made accessible to trusted parties so that they may retrieve event, recording, test, and heartbeat data for their own purposes. The SenseiQ Services web site provides an interactive interface for a client to access their sensor data with valid log-in credentials — but clients often wish to access data programmatically from a remote system, and to download that data in a recognisable form.

To deliver this, a web API portal has been created that provides querying capability via HTTP requests. The data stream is returned in JSON — an industry standard most remote systems can interpret. The portal follows RESTful conventions where practical.

Requests are POSTed to the portal as discussed in the request format section. Each request includes login credentials along with parameters describing the query. Because live-data responsiveness matters for some use cases, the API supports session login: when a client logs in, a token is returned that can stand in for the password on subsequent calls. The client is responsible for logging out once the interaction is complete.

Live streams are capped at two minutes. After that the session times out and must be restarted. This limit prevents unnecessary data transfer across the network. Start → capture → stop → repeat.

Accessing the API

A remote client can access the API at the following URL:

https://isds-services.senseisolutions.co.nz/ISDSWebServer/api-portal

Request format

Requests are POSTed to the URL above as HTTP requests. Query information is provided in plain-text format as a sequence of key/value pairs — all strings, enclosed in single or double quotes. The table below summarises keys that may (or must) appear.

KeyValue
usernameThe user name of the client in the SenseiQ Registry.
passwordThe password of the client in the SenseiQ Registry.
queryThe code of the query command (see tables below).
logintokenOptional. Login token for an active API session.
sensornameOptional. The name of the sensor — e.g. Proto-ISDS-1.
hostnameOptional. The host name of the sensor computer — e.g. Proto-BB-1.
sourceOptional. 1 = sensor itself, 2 = sensor archive on its server.
datasetnumberOptional. Index of the dataset on the sensor/server (0-based).
starttimeperiodOptional. Start of period as days-before-today. Defaults to before the first archived dataset.
endtimeperiodOptional. End of period as days-before-today. Defaults to today.
fieldchoicesOptional. Bitmask specifying required time series for query 30 (see Appendix A).
samplingtimestepOptional. Resampling time step (float, seconds) for query 30. E.g. 0.1F.

Example request using fetch:

const res = await fetch(
  "https://isds-services.senseisolutions.co.nz/ISDSWebServer/api-portal",
  {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    body: new URLSearchParams({
      username: "your-user",
      password: "your-password",
      query: "1",
    }),
  }
);
const data = await res.json();
console.log(data.logintoken);

Response format

All output from the portal is in JSON. The first field in every response is a requestcode indicating the success or otherwise of the request. If the request fails, only the requestcode is returned. See the request codes table for the full list.

Log into the API

Requestquery 1

KeyValue
usernameThe user name of the client in the SenseiQ Registry.
passwordThe password of the client.
query1

Response

{
  "requestcode": 0,
  "logintoken": 87856
}
The logintoken returned here can be used in future requests in place of the password.

Log out of the API

Requestquery 2

KeyValue
usernameThe user name of the client.
logintokenThe login token from query 1.
query2

Response

{
  "requestcode": 0
}

Start data stream for a sensor

Requestquery 3

KeyValue
usernameUser name.
logintokenLogin token.
query3
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1

Response

{
  "requestcode": 0
}

Stop data stream for a sensor

Requestquery 4

KeyValue
usernameUser name.
logintokenLogin token.
query4

Response

{
  "requestcode": 0
}

Get latest sensor measurements

Requestquery 5

KeyValue
usernameUser name.
logintokenLogin token.
query5

Response

{
  "requestcode": 0,
  "drift-mm": 0.2,
  "drift-percent": 0.07,
  "dx-mm": 0.14,
  "dy-mm": -0.17,
  "vx-mm/s": -0.3,
  "vy-mm/s": 2.1,
  "v-mm/s": 2.2,
  "pitch-deg": 0.001,
  "roll-deg": 0.002,
  "wx-deg/s": 0,
  "wy-deg/s": 0,
  "ax-g": 0.001,
  "ay-g": 0.0007,
  "az-g": -0.0002
}

Retrieve sensor list for a user

Requestquery 10

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query10

Response

{
  "requestcode": 0,
  "numberofsensors": 5,
  "sensors": [
    {
      "sensormodel": "SenseiQ Premium",
      "sensorname": "Proto-ISDS-1",
      "localhost": "Proto-BB-1",
      "owner": "Sense i Solutions Ltd",
      "location": "Room 123",
      "building": "SiSL HQ",
      "city": "Christchurch",
      "county": "New Zealand",
      "deploymentstatus": "Deployed",
      "deploymentstatuscode": 1
    }
    // …
  ]
}
Deployment status codes: 0 = In preparation, 1 = Deployed, 2 = Retired. Retired sensors omit owner and location.

Recent event alerts for a user's sensors

Requestquery 11

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query11

Returns details of all event alerts that occurred recently — typically the last 7 days, though this window may be altered by SiSL administrators.

Response

{
  "requestcode": 0,
  "numberofalerts": 15,
  "alerts": [
    {
      "eventname": "NZ-ISDS-6_Event#133",
      "date": "4.21:56am on 12/5/2025",
      "duration-s": 34.6,
      "sensor": {
        "sensorname": "NZ-ISDS-6",
        "localhost": "NZ-BB-6",
        "sensororientation": "Sensor pointing up",
        "floorseparation-mm": 2350
      },
      "deployment": {
        "owner": "Sense i Solutions Ltd",
        "location": "Room 123",
        "building": "SiSL HQ",
        "city": "Christchurch",
        "county": "New Zealand"
      },
      "alertinfo": {
        "orangethreshold-percent": 0.3,
        "redthreshold-percent": 1.0,
        "alertlevel": "Orange"
      },
      "maxstats": {
        "maxdrift-percent": 0.75,
        "maxdrift-mm": 12.4,
        "maxdx-mm": 11.8,
        "maxdy-mm": 3.1,
        "maxax-g": 0.178,
        "maxay-g": 0.012,
        "maxaz-g": 0.056
      }
    }
    // …
  ]
}

Number of datasets for a sensor

A single shape serves four query codes — one per dataset family: 21 datasets, 41 events, 61 recordings, 81 tests.

Request

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query21 / 41 / 61 / 81
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 = sensor, 2 = server archive

Response

{
  "requestcode": 0,
  "numberofdatasets": 17
}

Dataset date/time

Codes 22 / 42 / 62 / 82.

Request

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query22 / 42 / 62 / 82
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 or 2
datasetnumber0-based index in the archive

Response

{
  "requestcode": 0,
  "datasetdate": {
    "datestring": "12.50:01pm on 25/6/2025",
    "year": 2025,
    "month": 6,
    "day": 25,
    "hour": 12,
    "minute": 50,
    "second": 1,
    "nanosecond": 6578478,
    "unixmillisecond": 123456789
  }
}

Dataset name

Codes 23 / 43 / 63 / 83. Parameters identical to query 22.

Response

{
  "requestcode": 0,
  "datasetname": "Proto-ISDS-1_Event#7"
}

Dataset duration

Codes 24 / 44 / 64 / 84. Parameters identical to query 22.

Response

{
  "requestcode": 0,
  "duration-s": 37.22
}

Dataset details

Codes 25 / 45 / 65 / 85. Parameters identical to query 22. The alertinfo and maxstats blocks appear only for events.

Response

{
  "requestcode": 0,
  "datasetname": "Proto-ISDS-1_Recording#2",
  "datasettype": "Recording",
  "duration-s": 60.45,
  "datasetdate": {
    "datestring": "4.21:56am on 12/5/2025",
    "year": 2025, "month": 5, "day": 12,
    "hour": 4, "minute": 21, "second": 56,
    "nanosecond": 19877678,
    "unixmillisecond": 123456789
  },
  "deployment": {
    "owner": "Sense i Solutions Ltd",
    "location": "Room 123",
    "building": "SiSL HQ",
    "city": "Christchurch",
    "county": "New Zealand"
  },
  "alertinfo": {
    "orangethreshold-percent": 0.3,
    "redthreshold-percent": 1.0,
    "alertlevel": "Orange"
  },
  "maxstats": {
    "maxdrift-mm": 12.4,
    "maxdrift-percent": 0.75,
    "maxdx-mm": 11.8,
    "maxdy-mm": 3.1,
    "maxax-g": 0.178,
    "maxay-g": 0.012,
    "maxaz-g": 0.056
  },
  "layout": {
    "sensororientation": "Sensor pointing up",
    "floorseparation-mm": 2350
  }
}

All datasets details

Codes 26 / 46 / 66 / 86. Returns an array of dataset detail objects — same shape as query 25.

Request

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query26 / 46 / 66 / 86
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 or 2

Response

{
  "requestcode": 0,
  "numberofdatasets": 15,
  "datasets": [
    {
      "datasetname": "Proto-ISDS-1_Recording#2",
      "datasettype": "Recording",
      "duration-s": 60.45,
      "datasetdate": { "...": "…" },
      "deployment":  { "...": "…" },
      "alertinfo":   { "...": "events only" },
      "maxstats":    { "...": "events only" },
      "layout":      { "...": "…" }
    }
    // …
  ]
}
For query codes 46 / 66 / 86, the top-level key numberofdatasets is replaced by numberofevents, numberofrecordings, or numberoftests respectively; and datasets becomes events, recordings, or tests.

Dataset details within a time period

Codes 27 / 47 / 67 / 87.

Request

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query27 / 47 / 67 / 87
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 or 2
starttimeperiodOptional. Days before today. Default: pre-first-dataset.
endtimeperiodOptional. Days before today. Default: today.

Response

{
  "requestcode": 0,
  "startdate": "9.00:00am on 4/3/2025",
  "enddate":   "5.00:00pm on 31/6/2025",
  "numberofdatasets": 15,
  "datasets": [
    { /* same detail shape as query 25 */ }
    // …
  ]
}

Retrieve dataset data

Codes 28 (by index) and 29 (latest). Returns the complete dataset with all time series. The shape below shows an event; recordings and tests differ slightly — see recordings and tests.

Request

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query28 or 29
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 or 2
datasetnumberRequired for 28. Not required for 29.

Response

{
  "requestcode": 0,
  "dataset": {
    "datasetinfo": {
      "datasetname": "Proto-ISDS-1_Event#5",
      "datasettype": "Event",
      "sensorname": "Proto-ISDS-1",
      "starttime": { /* date object */ },
      "deployment": { /* deployment object */ },
      "alertinfo":  { /* only for events */ },
      "layout":     { "sensororientation": "…", "floorseparationinmm": 2250.0 }
    },
    "fieldnames": ["t (s)", "drift (mm)", "drift% (%)", "dx (mm)", "…"],
    "fielddata": [
      [0.000, 0.02, 0.00, 0.02],
      [0.005, 0.12, "…"],
      [0.010, 0.09, "…"]
      // …
    ]
  }
}
Invalid numerical values are represented by the JSON literal null in the fielddata arrays.

Retrieve event data

Codes 48 (by index) and 49 (latest). Structurally identical to queries 28 / 29 but constrained to events.

Retrieve recording data

Codes 68 (by index) and 69 (latest). Recordings are returned with separate optical and IMU time series.

Response

{
  "requestcode": 0,
  "dataset": {
    "datasetinfo": { /* no alertinfo for recordings */ },
    "opticalfieldnames": ["t (s)", "dxOpt (mm)", "…"],
    "opticalfielddata": [
      [0.00, 0.02],
      [60.00, 0.01]
    ],
    "imufieldnames": ["t (s)", "wx (deg/s)", "…"],
    "imufielddata": [
      [0.00, 0.02],
      [60.00, 0.01]
    ]
  }
}

Retrieve test data

Codes 88 (by index) and 89 (latest). Same flat shape as query 28, constrained to tests.

Retrieve heartbeat data

Requestquery 101

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query101
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 or 2

Response

{
  "requestcode": 0,
  "dataset": {
    "datasetinfo": { /* as per other datasets */ },
    "fieldnames": ["t (day)", "drift (mm)", "drift% (%)", "dx (mm)", "…"],
    "fielddata": [
      [0.000, 0.02, 0.00, 0.02],
      [0.005, 0.12, "…"],
      [25.05, 0.01, "…"]
    ]
  }
}
Note that for heartbeat data the time column is expressed in days, not seconds.

Dataset with selected fields, resampled

Query code 30 retrieves a dataset that includes only a chosen subset of time series, resampled at a lower frequency. Particularly useful for SenseiQ Lite sensors where bandwidth is constrained. A 10 Hz sampling rate (0.1 s time step) is a good default.

When the dataset is a recording, resampling only affects the IMU time series — optical time series are returned unchanged.

Request

KeyValue
usernameUser name.
logintoken or passwordDepending on login state.
query30
sensornamee.g. Proto-ISDS-1
hostnamee.g. Proto-BB-1
source1 or 2
datasetnumber0-based index
fieldchoicesBitwise-OR of field values — see Appendix A
samplingtimestepFloat in seconds, e.g. 0.1F

Response

Example: an event with only drift and dx, sampled at 10 Hz.

{
  "requestcode": 0,
  "dataset": {
    "datasetinfo": { /* as per query 28 */ },
    "fieldnames": ["t (s)", "drift (mm)", "dx (mm)"],
    "fielddata": [
      [0.00, 0.02,  0.01],
      [0.10, 0.12,  0.05],
      [0.20, 0.09,  0.02],
      [25.00, 0.01, -0.04]
    ]
  }
}

Request Builder

Fill in the form below to generate a ready-to-run snippet for any API query. The builder composes the request locally — nothing is sent to the server.

Build a request
not used by query 1
curl -X POST 'https://isds-services.senseisolutions.co.nz/ISDSWebServer/api-portal' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data 'username=your-user&query=1&sensorname=Proto-ISDS-1&hostname=Proto-BB-1&source=1'

Query code summary

A sensor can acquire three dataset types — events (captured during an earthquake), recordings (captured for a fixed period on command), and tests (captured during installation). The word dataset can refer to any of these. Heartbeat data is also queryable.

General

QueryResponse
1Log into the API
2Log out of the API
3Start a live data stream for a sensor
4Stop the live data stream for a sensor
5Get the last measurement from a sensor
10Retrieve a list of all sensors for a user
11Retrieve recent event alerts for a user's sensors

Dataset

QueryResponse
21Number of datasets at source
22Dataset date/time
23Dataset name
24Dataset duration
25Dataset details
26Details of all datasets
27Details of all datasets in a period
28Data of a dataset
29Data of the latest dataset
30Dataset data with selected fields, resampled

Event

QueryResponse
41Number of events
42Event date/time
43Event name
44Event duration
45Event details
46Details of all events
47Events in a period
48Event data
49Latest event data

Recording

QueryResponse
61Number of recordings
62Recording date/time
63Recording name
64Recording duration
65Recording details
66Details of all recordings
67Recordings in a period
68Recording data
69Latest recording data

Test

QueryResponse
81Number of tests
82Test date/time
83Test name
84Test duration
85Test details
86Details of all tests
87Tests in a period
88Test data
89Latest test data

Heartbeat

QueryResponse
101Heartbeat dataset

Request codes

Every response includes a requestcode indicating success or failure. On failure, only this field is returned:

{ "requestcode": 12 }
CodeMeaning
0Query was successful.
1No registry information available.
2The registry is offline.
3Invalid user name.
4Invalid password.
5A new password must be set manually before access is granted.
6The specified sensor is invalid.
7An invalid source has been specified.
8The requested source (sensor or archive) is offline.
9The specified dataset is invalid.
10Missing parameter.
11Invalid parameter.
12Invalid query code.
13User data unavailable.
14Invalid token.
15User not logged into API.
16User log in to API failed.
17User log out of API failed.
18Live data stream could not be started.
19Invalid measurement.
20Invalid event alerts.

Appendix A · Field choices

Query code 30 allows you to retrieve a dataset containing only a selected subset of time series. The fieldchoices parameter specifies which fields are wanted; it is a long built by bitwise-OR-ing the values below.

Example

To request drift, dx, dy, v, pitch, roll, wx, wy, ax, ay, az, OR the corresponding values together:

fieldchoices = 0x00F81810DL  // trailing L signifies a long
FieldValue (hex)
drift0x000000001L
drift %0x000000002L
dx0x000000004L
dy0x000000008L
dxOpt0x000000010L
dyOpt0x000000020L
dxRot0x000000040L
dyRot0x000000080L
v0x000000100L
vx0x000000200L
vy0x000000400L
vxOpt0x000000800L
vyOpt0x000001000L
vxRot0x000002000L
dvRot0x000004000L
pitch0x000008000L
roll0x000010000L
wx0x000020000L
wy0x000040000L
ax0x000080000L
ay0x000100000L
az0x000200000L