Skip to content

Experiments controller

Petr Štechmüller edited this page Aug 28, 2020 · 2 revisions

Access point

The Experiment's base access point has address: '/api/experiments'

all

  • Description: retrieves all available experiments for one user
  • Method: GET
  • Access point: /
  • Authentication: NOT REQUIRED
  • Return value: Experiment[]
  • Error codes: -

nameExists

  • Description: check if the entered name exists or not
  • Method: GET
  • Access point: /name-exists/:name/:id
  • Parameters:
    • name: name of an experiment
    • id: optional parameter; can contain ID of an experiment or value new
  • Authentication: NOT REQUIRED
  • Return value: ResponseObject<{ exists: boolean }>
  • Error codes: -

usedOutputMultimedia

  • Description: retrieves all used multimedia for selected experiment
  • Method: GET
  • Access point: /multimedia/:id
  • Parameters:
    • id: ID of an experiment
  • Authentication: REQUIRED
  • Return value: ResponseObject<{ audio: {}; image: {} }>
  • Error codes:
    • 10300 - experiment ID not found

validate

  • Description: validate selected experiment
  • Method: GET
  • Access point: /validate
  • Authentication: NOT REQUIRED
  • Return value: ResponseObject<boolean>
  • Error codes:

sequencesForExperiment

  • Description: retrieves all sequences for selected experiment ID
  • Method: GET
  • Access point: sequences-for-experiment/:id
  • Parameters:
    • id: ID of an experiment
  • Authentication: REQUIRED
  • Return value: ResponseObject<Sequence[]>
  • Error codes: -

sequenceFromExperiment

  • Description: creates new sequence based on experiment
  • Method: GET
  • Access point: sequence-from-experiment/:id/:name/:size
  • Parameters:
    • id: ID of an experiment
    • name: name of new sequence
    • size: size of new sequence
  • Authentication: REQUIRED
  • Return value: ResponseObject<Sequence>
  • Error codes:
    • 10300 - experiment ID not found
    • 30300 - sequence ID not found
    • 30301 - sequence was not created
    • 30305 - experiment does not support sequences

experimentById

  • Description: retrieves experiment by ID
  • Method: GET
  • Access point: /:id
  • Parameters:
    • id: ID of an experiment
  • Authentication: NOT REQUIRED
  • Return value: ResponseObject<Experiment>
  • Error codes:
    • 10300 - experiment ID not found

insert

  • Description: creates new experiment
  • Method: POST
  • Access point: /
  • Body: Experiment
  • Authentication: REQUIRED
  • Return value: ResponseObject<Experiment>
  • Error codes:
    • 10301 - experiment was not created
    • 10304 - experiment is not valid

update

  • Description: updates existing experiment
  • Method: PATCH
  • Access point: /
  • Body: Experiment
  • Authentication: REQUIRED
  • Return value: ResponseObject<Experiment>
  • Error codes:
    • 10300 - experiment ID not found
    • 10302 - experiment is not updated
    • 10304 - experiment is not valid

delete

  • Description: delete selected experiment
  • Method: DELETE
  • Access point: /:id
  • Parameters:
    • id: ID of an experiment
  • Authentication: REQUIRED
  • Return value: ResponseObject<Experiment>
  • Error codes:
    • 10300 - experiment ID not found
    • 10303 - experiment was not deleted
Home * [x] [Configuration](https://github.com/neuro-stimulator/neuro-server/wiki/Configuration)
Experiments
Sequences
Experiment results
Stimulator
Experiment player
Clone this wiki locally