Project requests

project_close

Close an open project.

Request

Key

Value

cmd

“project_close”

data

project_close data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

force

Boolean

No

If you want to close a project with unsaved data set this to true. (false by default)

{
    "project_id": 1,
    "force": false
}

Response

Key

Value

cmd

“project_close”

project_crop_data

Crop all data.

Request

Key

Value

cmd

“project_crop_data”

data

project_crop_data data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

start

Number

Yes

From sample time in seconds.

end

Number

Yes

To sample time in seconds.

{
    "project_id": 1,
    "start": 2.5,
    "end": 10.50,
}

Response

Key

Value

cmd

“project_crop_data”

project_get_last_recording

Return last captured recording.

Request

Key

Value

cmd

“project_get_last_recordong”

data

project_get_last_recording data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

{
    "project_id": 1,
}

Response

Key

Value

cmd

“project_get_last_recording”

data

project_get_last_recording data

Data

Key

Type

Required

Description

recording_id

Number

Yes

Recording id of last recording, or -1 if no recordings exists.

name

String

No

Name of the recording

running

Boolean

No

True for ongoing recordings

start-time

String

No

Start of recording in ISO8601 format with milliseconds (from otii version 2.7.2)

{
    "recording_id": 0,
    "name": "06/04 10:11:03",
    "running": false,
    "start-time": "2020-01-24T16:16:54.019Z"
}

project_get_recordings

Return list of captured recordings.

Request

Key

Value

cmd

“project_get_recordings”

data

project_get_recordings data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

{
    "project_id": 1,
}

Response

Key

Value

cmd

“project_get_recordings”

data

project_get_recordings data

Data

Key

Type

Required

Description

recordings

Array

Yes

List of Recording objects, empty array if there is no recordings.

{
    "recordings": []
}

Recording object

Key

Type

Required

Description

recording_id

Number

Yes

Recording id

name

String

Yes

Name of the recording

running

Boolean

Yes

True for ongoing recordings

start-time

String

Yes

Start of recording in ISO8601 format with milliseconds (from otii version 2.7.2)

{
    "recording_id": 1,
    "name": "06/04 10:11:03",
    "running": false,
    "start-time": "2020-01-24T16:16:54.019Z"
}

project_save

Save the currently open 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

“project_save”

data

project_save data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

filename

String

Yes

File name for the project.

force

Boolean

No

Set to true to overwrite existing file. (false by default)

progress

Boolean

No

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

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

Response

Key

Value

cmd

“project_save”

data

project_save data

Data

Key

Type

Required

Description

filename

String

Yes

Absolute path to saved project file .

{
    "filename": "myMeasurement.otii",
}

Progress

Key

Value

cmd

“project_save”

progress_value

Progress of saving described with a value from 0.0 to 1.0.

project_start_recording

Start a new recording.

Request

Key

Value

cmd

“project_start_recording”

data

project_start_recording data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

{
    "project_id": 1,
}

Response

Key

Value

cmd

“project_start_recording”

project_stop_recording

Stop the running recording.

Request

Key

Value

cmd

“project_stop_recording”

data

project_stop_recording data

Data

Key

Type

Required

Valid values

project_id

Number

Yes

Project id

{
    "project_id": 1,
}

Response

Key

Value

cmd

“project_stop_recording”