Skip to content

Stimuli Timeline Control API

Martin Konopka edited this page Apr 23, 2018 · 2 revisions

Continue to the next step

POST /api/session/recording/timeline/continue

Forces continue to the next step in the timeline, if there is an active recording. If no recording is open or running, it is ignored. If the current step before attempting continue is last in the timeline, this call will finish the recording.

Request

  • Parameters: None.
  • Body: None.

Response

Empty.

Examples

Session recording is running and was started from the example session definition. To show effects of requesting continue, we use calls to Session Control - Get current recording details, note the change in the currentStep property.

$ curl -X GET http://localhost:55555/api/session/recording/ 

{
    "id": "2018-03-31T04_03_11",
    "state": "Running",
    "startedAt": "2018-03-31T04:03:13.2172596",
    "isFinished": false,
    "currentStep": "LaunchProgram",
    "definition": { /* Session Definition object */ }
}
$ curl -X POST \
       --data '' \
       http://localhost:55555/api/session/recording/timeline/continue
$ curl -X GET http://localhost:55555/api/session/recording/ 

{
    "id": "2018-03-31T04_03_11",
    "state": "Running",
    "startedAt": "2018-03-31T04:03:13.2172596",
    "isFinished": false,
    "currentStep": "Questionary",
    "definition": { /* Session Definition object */ }
}

Continue to new step

POST /api/session/recording/timeline/continue/step

Injects new step to the stimuli timeline and advances to it. The new step is passed in the request body and has the same structure as steps defined in the StepDefinition objects. If no recording is open or running, it is ignored.

Request

Response

Empty.

Examples

Session recording is running and was started from the example session definition. To show effects of injecting new step, we use calls to Session Control - Get current recording details, note the change in the currentStep property.

$ curl -X GET http://localhost:55555/api/session/recording/ 

{
    "id": "2018-03-31T04_03_11",
    "state": "Running",
    "startedAt": "2018-03-31T04:03:13.2172596",
    "isFinished": false,
    "currentStep": "LaunchProgram",
    "definition": { /* Session Definition object */ }
}
$ curl -X POST \
       -h 'Content-Type: application/json' \
       --data '{ \
        "action": \
        { \
            "actionType": "Instructions",  \
            "instructions": "Answer questions about your personality on the next website." \
        }, \
        "completion": \
        { \
            "duration": "00:00:15" \
        } \
     }' \
     http://localhost:55555/api/session/recording/timeline/step
$ curl -X GET http://localhost:55555/api/session/recording/ 

{
    "id": "2018-03-31T04_03_11",
    "state": "Running",
    "startedAt": "2018-03-31T04:03:13.2172596",
    "isFinished": false,
    "currentStep": "Instructions",
    "definition": { /* Session Definition object */ }
}
Clone this wiki locally