InnerSpace API Reference

Documentation for the InnerSpace APIs

Getting Started:

  1. Contact sales@innerspace.io for developer access. They will provide you with a ClientID and a ClientSecret.

  2. Call getAccessToken API ( POST /auth/getAccessToken) with ClientInfo

  3. Call APIs with accessToken as Bearer authentication

    e.g. curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer ( accessToken should be here)' '( HOST is here)/data/wait-times/sites/101/zones/20/fine'
API Endpoint
https://api.innerspace.io/v1
Schemes: https

Authentication

oauth2

description
authorizationUrl
/auth/oauth2
flow
implicit

auth

get AccessToken by ClientID and ClientSecret to access Services APIs

POST /auth/getAccessToken

clientInfo

Request Example
{
  "client_id": "ThisIsForClientId",
  "client_secret": "ThisIsForClientSecret",
  "identifier": "ThisIsForTest."
}
200 OK

Successful operation

Response Example (200 OK)
{
  "access_token": "ThisIsForAccessToken",
  "scope": "string",
  "expires_in": 72000,
  "token_type": "Bearer"
}

data

Retrieve wait-times by site and zone

GET /data/wait-times/sites/{siteId}/zones/{zoneId}/{granularity}
siteId

The site id of the indoor map.

type
integer (int32)
in
path
zoneId

The zone inside the site.

type
integer (int32)
in
path
granularity

fine = most granular intervals possible for a 1 hour duration (typically 5 or 10 minute intervals)
coarse = less granular intervals, typically hourly, for 24 hour duration.

type
string fine, coarse fine
in
path
date-time-start

ISO 8601 formatted date (YYYY-MM-DDTHH:MM:SSSZ)
e.g. 2018-07-24T15:24:51.357Z
default = NOW
rounded to the nearest hour for (coarse) granularity
rounded to the nearest minute for (fine) granularity

type
string (date-time)
in
query

Successful operation

Response Example (200 OK)
{
  "site-id": 101,
  "zone-id": 163,
  "zone-label": "Meeting Room 1",
  "granularity": "fine",
  "data-granularity": "PT5M",
  "date-time-start": "2018-07-24T15:24:51.357Z",
  "data": [
    {
      "site-id": "integer (int64)",
      "zone-id": 163,
      "date-time": "2018-07-24T15:24:51.357Z",
      "granularity": "string",
      "wait-time": 600,
      "occupancy": 20,
      "service-rate": 2
    }
  ]
}

Retrieve wait-times by site and zone

GET /data/wait-times
site-id

The site id of the indoor map.

type
integer (int32)
in
query
zone-id

The zone inside the site.

type
integer (int32)
in
query
granularity

finer = 1 minute granular intervals possible for a 15 minute duration
fine = 5 minute granular intervals possible for a 1 hour duration
coarse = 1 hour granular intervals for 24 hour duration.

type
string finer, fine, coarse fine
in
query
timestamp-start

ISO 8601 formatted date (YYYY-MM-DDTHH:MM:SSSZ)
e.g. 2018-07-24T15:24:51.357Z
default = NOW
rounded to the nearest hour for (coarse) granularity
rounded to the nearest minute for (fine) granularity

type
integer (int64)
in
query

Successful operation

Response Example (200 OK)
{
  "site-id": 101,
  "zone-id": 163,
  "zone-label": "Meeting Room 1",
  "granularity": "fine",
  "data-granularity": "PT5M",
  "date-time-start": "2018-07-24T15:24:51.357Z",
  "data": [
    {
      "site-id": "integer (int64)",
      "zone-id": 163,
      "date-time": "2018-07-24T15:24:51.357Z",
      "granularity": "string",
      "wait-time": 600,
      "occupancy": 20,
      "service-rate": 2
    }
  ]
}

Retrieve visits by site or zone

GET /data/visits
site-id

The site id of the indoor map.

type
integer (int32)
in
query
zone-id

The zone inside the site.

type
integer (int32)
in
query
zone-set-id

The id of zone group

type
integer (int32)
in
query
timestamp

Timestamps which combines start and end with operator as a String. If this filed is null, default is le:current_time (The date format is ISO-8601 timestamp)
Operator List
lt = less than
le = less than or equal to
gt = greater than
ge = greater than or equal to
e.g. le:2018-07-24T15:24:51.357Z (only end is possible)
e.g. gt:2018-07-24T15:24:51.357Z (only start is possible)
e.g. gt:2018-07-24T15:24:51.357Z,le:2018-07-24T15:30:51.357Z (combine start and end is possible)

type
string
in
query
limit

The maximum number of results to return. Defaults to 500, which is also the maximum allowed value.

type
integer (int32) 500
in
query
sorting

Sorting by zone-id
or zone-set-id
or timestamp-start
or timestamp-end
Format is - or + with parameters. Default is -timestamp-start

[Operator List]
+ = asc
- = desc

e.g. +zone_id or -timestamp-start

type
string -timestamp-start
in
query
200 OK

Successful operation

Response Example (200 OK)
{
  "zone-id": 163,
  "source-id": "90a073c99352244ebf0376c7aab871292329309e=",
  "timestamp-start": "2018-07-24T15:24:51.357Z",
  "timestamp-end": "2018-07-24T15:24:51.357Z",
  "session-id": "90a073c993521444bf0376c7avb891292329309e",
  "zone-set-id": 55
}

Retrieve a list of sites your account has access to

GET /data/sites
200 OK

Successful operation

Response Example (200 OK)
{
  "id": 163,
  "site-code": "101 - InnerSpace Office",
  "time-zone": "America/New_York"
}

Retrieve a list of zones for a site

GET /data/zones
site-id

The site id of the indoor map.

type
integer (int32)
in
query
200 OK

Successful operation

Response Example (200 OK)
{
  "id": 163,
  "zone-set-id": 55,
  "site-id": 163,
  "label": "East-Wing Cafeteria"
}

Retrieve occupancy by site and zone

GET /data/occupancy
site-id

The site id of the indoor map.

type
integer (int32)
in
query
zone-id

The zone inside the site.

type
integer (int32)
in
query
granularity

finer = 1 minute granular intervals possible for a 15 minute duration
fine = 5 minute granular intervals possible for a 1 hour duration
coarse = 1 hour granular intervals for 24 hour duration.

type
string finer, fine, coarse fine
in
query
timestamp-start

ISO 8601 formatted date (YYYY-MM-DDTHH:MM:SSSZ)
e.g. 2018-07-24T15:24:51.357Z
default = NOW
rounded to the nearest hour for (coarse) granularity
rounded to the nearest minute for (fine) granularity

type
integer (int64)
in
query

Successful operation

Response Example (200 OK)
{
  "site-id": 101,
  "zone-id": 163,
  "zone-label": "Meeting Room 1",
  "granularity": "fine",
  "data-granularity": "PT5M",
  "date-time-start": "2018-07-24T15:24:51.357Z",
  "data": [
    {
      "site-id": "integer (int64)",
      "zone-id": 163,
      "date-time": "2018-07-24T15:24:51.357Z",
      "granularity": "string",
      "wait-time": 600,
      "occupancy": 20,
      "service-rate": 2
    }
  ]
}

ui

Schema Definitions

AccessToken: object

access_token: string
scope: string
expires_in: integer (int64)
token_type: string
Example
{
  "access_token": "ThisIsForAccessToken",
  "scope": "string",
  "expires_in": 72000,
  "token_type": "Bearer"
}

ClientInfo: object

client_id: string

A unique ID used to identify your application.

client_secret: string

A unique key used in combination with the client_id to identify your application and grant access to InnerSpace's APIs. Should never be shared.

identifier: string

A human readable label to identify your application.

Example
{
  "client_id": "ThisIsForClientId",
  "client_secret": "ThisIsForClientSecret",
  "identifier": "ThisIsForTest."
}

ZoneWaitTime: object

site-id: integer (int64)
zone-id: integer (int64)

The id of the zone inside the site.

date-time: string

Date of current wait-time. (ISO 8601 formatted date.)

granularity: string
wait-time: number (double)

Measure or prediction of how long, in minutes, the LAST person to enter remains in a zone from entry to exit.

occupancy: integer (int64)

Count/prediction of people in the zone.

service-rate: number (double)

Measure of the last number of people served per minute.

Example
{
  "site-id": "integer (int64)",
  "zone-id": 163,
  "date-time": "2018-07-24T15:24:51.357Z",
  "granularity": "string",
  "wait-time": 600,
  "occupancy": 20,
  "service-rate": 2
}

ZoneWaitTimeGrouped: object

site-id: integer (int64)

Identifier of the site

zone-id: integer (int64)

The zone inside the site

zone-label: string

Descriptive name for the zone.

granularity: string coarse, fine

Fine - most granular intervals possible for a 1 hour duration (typically 5 or 10 minute intervals)
Coarse - less granular intervals, typically hourly, for 24 hour duration

data-granularity: string

The time period for each element in the wait-time/occupancy array. (ISO-8601 formatted duration.)

date-time-start: string

The beginning of the requested data. (ISO 8601 formatted date.)

data: ZoneWaitTime
Example
{
  "site-id": 101,
  "zone-id": 163,
  "zone-label": "Meeting Room 1",
  "granularity": "fine",
  "data-granularity": "PT5M",
  "date-time-start": "2018-07-24T15:24:51.357Z",
  "data": [
    {
      "site-id": "integer (int64)",
      "zone-id": 163,
      "date-time": "2018-07-24T15:24:51.357Z",
      "granularity": "string",
      "wait-time": 600,
      "occupancy": 20,
      "service-rate": 2
    }
  ]
}

AuthUser: object

groupName: string
clientID: string
identifier: string
accessToken: string
name: string
Example
{
  "groupName": "string",
  "clientID": "string",
  "identifier": "string",
  "accessToken": "string",
  "name": "string"
}

Visit: object

zone-id: integer (int64)

The id of the zone inside the site.

source-id: string

A unique identifier which binds to an individual device detected by InnerSpace Sensors.

timestamp-start: string

Start date of the visit. (ISO 8601 formatted date.)

timestamp-end: string

End date of the visit. (ISO 8601 formatted date.)

session-id: string

A unique identifier assigned to a device for the duration of that device's visit to a site.

zone-set-id: integer (int64)

A unique identifier indicating a collection of zones in which this visit belongs to.

Example
{
  "zone-id": 163,
  "source-id": "90a073c99352244ebf0376c7aab871292329309e=",
  "timestamp-start": "2018-07-24T15:24:51.357Z",
  "timestamp-end": "2018-07-24T15:24:51.357Z",
  "session-id": "90a073c993521444bf0376c7avb891292329309e",
  "zone-set-id": 55
}

Site: object

id: integer (int32)

The id of the site.

site-code: string

A text description of the site.

time-zone: string

The timezone the site is located in.

Example
{
  "id": 163,
  "site-code": "101 - InnerSpace Office",
  "time-zone": "America/New_York"
}

Zone: object

id: integer (int64)

The id of the zone inside the site.

zone-set-id: integer (int64)

A unique identifier indicating a collection of zones in which this zone belongs to.

site-id: integer (int64)

The id of the site.

label: string

A label description of the zone

Example
{
  "id": 163,
  "zone-set-id": 55,
  "site-id": 163,
  "label": "East-Wing Cafeteria"
}