Spaces

Get Spaces

get

Returns information about all physical spaces in the venue

Responses
200
OK
application/json
get
GET /psapi/spaces HTTP/1.1
Host: aaa-1234.local
Accept: */*
{
  "ANY_ADDITIONAL_PROPERTY": {
    "active_environmental_conditions_id": "123e4567-e89b-12d3-a456-426614174000",
    "active_preset_id": "123e4567-e89b-12d3-a456-426614174000",
    "environmental_conditions": {
      "atmospheric_pressure_pascal": 101325,
      "humidity_percentage": 55,
      "temperature_celsius": 21.5
    },
    "name": "Theatre hall",
    "preset_ids": [
      "text"
    ]
  }
}

Get Space

get

Returns information for a specific physical space in the venue

Path parameters
spaceIDstringRequired

Space ID

Responses
200
OK
application/json
get
GET /psapi/spaces/{spaceID} HTTP/1.1
Host: aaa-1234.local
Accept: */*
{
  "active_environmental_conditions_id": "123e4567-e89b-12d3-a456-426614174000",
  "active_preset_id": "123e4567-e89b-12d3-a456-426614174000",
  "environmental_conditions": {
    "atmospheric_pressure_pascal": 101325,
    "humidity_percentage": 55,
    "temperature_celsius": 21.5
  },
  "name": "Theatre hall",
  "preset_ids": [
    "text"
  ]
}

Change details of a space

patch

This endpoint can be used to modify details of a physical space in the venue.

Environmental Conditions

To set the environmental conditions for a space make a PATCH request to /spaces/{spaceID} with a body that contains the environmental_conditions key, like in the following example:

{
  "environmental_conditions": {
    "atmospheric_pressure_pascal": 101345,
    "humidity_percentage": 34,
    "temperature_celsius": 23.4
  }
}

When environmental conditions are submitted, the system will persist them. To activate and identify the closest matching set of stored conditions for the currently selected preset you have to apply the environmental condition with a post request to /spaces/{spaceID}/environmental-conditions/apply.

Active Preset

The following request body changes the active preset of the space:

{
  "active_preset_id": "7aa69f98-b697-11ed-b9c5-b445062a7e37"
}

Note that the ID used here must match one of the presets listed for the space, or the request will get a response of 400 Bad Request.

A change of the active preset will trigger a match of the environmental conditions.

Path parameters
spaceIDstringRequired

Space ID

Body
active_preset_idstring · uuidOptional
Responses
200
OK
application/json
patch
PATCH /psapi/spaces/{spaceID} HTTP/1.1
Host: aaa-1234.local
Content-Type: application/json
Accept: */*
Content-Length: 177

{
  "active_preset_id": "123e4567-e89b-12d3-a456-426614174000",
  "environmental_conditions": {
    "atmospheric_pressure_pascal": 101325,
    "humidity_percentage": 55,
    "temperature_celsius": 21.5
  }
}
{
  "active_environmental_conditions_id": "123e4567-e89b-12d3-a456-426614174000",
  "active_preset_id": "123e4567-e89b-12d3-a456-426614174000",
  "environmental_conditions": {
    "atmospheric_pressure_pascal": 101325,
    "humidity_percentage": 55,
    "temperature_celsius": 21.5
  },
  "name": "Theatre hall",
  "preset_ids": [
    "text"
  ]
}

Apply the stored environmental conditions for a space

post

This endpoint is used to apply the environmental conditions in a space. The algorithm will identify the closest set of stored conditions for the current active preset and will activate those. This might result in an audible effect, glitch.

Path parameters
spaceIDstringRequired

Space ID

Responses
200
OK
post
POST /psapi/spaces/{spaceID}/environmental-conditions/apply HTTP/1.1
Host: aaa-1234.local
Accept: */*

No content

Stream Spaces Updates

get

This endpoint can be used to stream updates about spaces through WebSockets. The payload returned is the same as in GET /spaces but only the space that has changed will be populated.

Find a Javascript client to use use this endpoint below.

const WebSocket = require('ws');

const client = new WebSocket('ws://localhost:6789/ws/spaces');
client.on('message', msg => console.log("Spaces update:" + msg.toString()));
Responses
200
OK
get
GET /psapi/ws/spaces HTTP/1.1
Host: aaa-1234.local
Accept: */*
200

OK

No content

Last updated

Was this helpful?