{
  "openapi": "3.0.0",
  "info": {
    "title": "Labvanced Data API",
    "description": "This API provides download access to recorded participant sessions.",
    "contact": {
      "email": "contact@labvanced.com"
    },
    "version": "1.0.0"
  },
  "paths": {
    "/api/{expId}/download/{recSessionId}": {
      "get": {
        "summary": "downloads participant data",
        "description": "Download recording data in csv file format as per configuration in exportSettings given on 'Dataview & Export' page.",
        "parameters": [
          {
            "name": "expId",
            "in": "path",
            "description": "the experiment id",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "recSessionId",
            "in": "path",
            "description": "the rec_session_id to download",
            "required": true,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "the recorded session data as a compressed zip file",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "bad input parameter"
          }
        }
      }
    },
    "/api/{expId}/sessions": {
      "get": {
        "summary": "get recorded sessions",
        "description": "Get all the recorded session details for given expId.",
        "parameters": [
          {
            "name": "expId",
            "in": "path",
            "description": "the experiment id",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "the recorded session information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/recSession"
                }
              }
            }
          },
          "400": {
            "description": "bad input parameter"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "recSession": {
        "type": "object",
        "properties": {
          "rec_session_id": {
            "type": "integer",
            "format": "int32"
          },
          "exp_subject_id": {
            "type": "integer",
            "format": "int32"
          },
          "session_nr": {
            "type": "integer",
            "format": "int32"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "subject_code": {
            "type": "string"
          },
          "group_nr": {
            "type": "integer",
            "format": "int32"
          },
          "last_completed_session_nr": {
            "type": "integer",
            "format": "int32"
          },
          "crowdsourcing_subj_id": {
            "type": "string"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
