Skip to content

Session Settings API

martinkonopka edited this page Feb 12, 2019 · 3 revisions

Read-write access to the Session settings during recording. Session settings contains primitive data about the session recording and results of certain steps, e.g., Questionary step. See Session Data - Session settings for details.

Names of the settings sections and keys are case sensitive

Read setting

GET /api/session/recording/settings/{section}/{key}

Returns current value of the session recording setting saved with the key in the section, both parameters are set in the URI. If no value exists for requested setting or no session is running, null value is returned.

Request

  • Parameters:
    • section (URI) - name of the settings section, e.g., Session.
    • key (URI) - name of the setting to read from the section, e.g., StartedAt from Session to return timestamp when the current recording started.
  • Body: none.

Response

  • string value of the requested setting; otherwise null, if it does not exist or no session is running.

Examples

Read the timestamp of when the session recording started.

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

"2018-03-15T10:44:57.8399515+01:00"

Read the participant's name entered in the question Name of the User questionary (Welcome step in the sample session definition).

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

"John Locke"

Write setting

POST /api/session/recording/settings/{section}/{key}

Sets the value for the session recording setting. If no such setting exists and there is a session recording running, the setting is created. Written values are saved in the session recording data.

Request

  • Parameters:
    • section (URI) - name of the settings section, e.g., Airlines.
    • key (URI) - name of the setting to write to the section, e.g., Selected to store participant's preference.
  • Body: string value of the setting.

Response

200 OK HTTP Status code if the setting was saved, otherwise 400 Bad Request.

Examples

Write string value representing user's choice in an airline selection.

$ curl -X POST \
       -H "Content-Type: application/json" \
       http://localhost:55555/api/session/recording/settings/Airlines/Selected \
       --data '"Oceanic Airlines"'
Clone this wiki locally