Otii requests

otii_create_project

Create a new project.

Request

Key

Value

cmd

“otii_create_project”

Response

Key

Value

cmd

“otii_create_project”

data

otii_create_project data

Data

Key

Type

Required

Description

project_id

Number

Yes

The project id.

{
    "project_id": 1
}

otii_get_active_project

Returns the active project, if there is one.

Request

Key

Value

cmd

“otii_get_active_project”

Response

Key

Value

cmd

“otii_get_active_project”

data

otii_get_active_project data

Data

Key

Type

Required

Description

project_id

Number

Yes

The project id if one exists, otherwise -1.

{
    "project_id": 1
}

otii_get_device_id

Get device id from device name.

Request

Key

Value

cmd

“otii_get_device_id”

data

otii_get_device_id data

Data

Key

Type

Required

Valid values

device_name

String

Yes

Device name.

{
    "device_name": "Arc"
}

Response

Key

Value

cmd

“otii_get_device_id”

data

otii_get_device_id data

Data

Key

Type

Required

Description

device_id

String

Yes

Device id of the first device with the requested name.

{
    "device_id": "Arc512031204843494E3130393033313036"
}

otii_get_devices

List of connected devices.

Request

Key

Value

cmd

“otii_get_devices”

data

otii_get_devices data

Data

Key

Type

Required

Valid values

timeout

int

No

Timeout in seconds (defaults to 0 seconds)

{
    "timeout": 5
}

Response

Key

Value

cmd

“otii_get_devices”

data

otii_get_devices data

Data

Key

Type

Required

Description

devices

Array

Yes

List of Device objects, empty array if no connected devices

{
    "devices": []
}

Device object

Key

Type

Required

Description

device_id

String

Yes

Unique id for the device

name

String

Yes

Name of the device

type

String

Yes

Type of device (Arc/UART)

{
    "device_id": "Arc12345678912345678912345678900001",
    "name": "Arc",
    "type": "Arc"
}

otii_open_project

Open an existing project.

If the filename passed to this function is relative, it will be relative to the server setting ‘Project save destination’ in Otii.

Request

Key

Value

cmd

“otii_open_project”

data

otii_open_project data

Data

Key

Type

Required

Valid values

filename

String

Yes

File name for the project.

force

Boolean

No

Set to true to open a file even if unsaved data exists. (false by default)

progress

Boolean

No

To receive progress notifications when opening long recordings set this to true. (false by default)

{
    "filename": "myMeasurement.otii",
    "force": true,
    "progress": false
}

Response

Key

Value

cmd

“otii_open_project”

data

otii_open_project data

Data

Key

Type

Required

Descriptionjk

project_id

Number

Yes

The project id of the opened project.

filename

String

Yes

Absolute path to opened project file.

{
    "project_id": 1,
    "filename": "/Users/qoitech/Documents/otii/myMeasurement.otii"
}

otii_set_all_main

Turn on or off the main power on all connected devices.

Request

Key

Value

cmd

“otii_set_all_main”

data

otii_set_all_main data

Data

Key

Type

Required

Valid values

enable

Boolean

Yes

True turns on power, false turns off power.

{
    "enable": true
}

Response

Key

Value

cmd

“otii_set_all_main”

otii_shutdown

Shutdown TCP server.

Request

Key

Value

cmd

“otii_shutdown”

Response

Key

Value

cmd

“otii_shutdown”