openapi: 3.0.1
info:
  title: TSAPI
  version: v1
  x-apisguru-categories:
    - analytics
  x-logo:
    url: https://www.tsapi.net/wp-content/uploads/2019/11/cropped-icon-black-1-180x180.png
  x-origin:
    - format: openapi
      url: https://api.tsapi.net/swagger/v1/swagger.json
      version: "3.0"
  x-providerName: tsapi.net
security:
  - basic: []
paths:
  /Surveys:
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/SurveyDetail"
                type: array
            text/json:
              schema:
                items:
                  $ref: "#/components/schemas/SurveyDetail"
                type: array
            text/plain:
              schema:
                items:
                  $ref: "#/components/schemas/SurveyDetail"
                type: array
          description: Success
      summary: Returns a list of available Surveys
      tags:
        - Surveys
  "/Surveys/{surveyId}/Interviews":
    get:
      parameters:
        - in: path
          name: surveyId
          required: true
          schema:
            format: uuid
            type: string
        - in: query
          name: start
          schema:
            format: int32
            type: integer
        - in: query
          name: maxLength
          schema:
            format: int32
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Interview"
                type: array
            text/json:
              schema:
                items:
                  $ref: "#/components/schemas/Interview"
                type: array
            text/plain:
              schema:
                items:
                  $ref: "#/components/schemas/Interview"
                type: array
          description: Success
      summary: Fetches some interview records for a specific survey
      tags:
        - Surveys
  "/Surveys/{surveyId}/Metadata":
    get:
      parameters:
        - in: path
          name: surveyId
          required: true
          schema:
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SurveyMetadata"
            text/json:
              schema:
                $ref: "#/components/schemas/SurveyMetadata"
            text/plain:
              schema:
                $ref: "#/components/schemas/SurveyMetadata"
          description: Success
      summary: Fetches the metadata for a specific survey
      tags:
        - Surveys
components:
  schemas:
    AltLabel:
      additionalProperties: false
      properties:
        langIdent:
          nullable: true
          type: string
        mode:
          allOf:
            - $ref: "#/components/schemas/AltLabelMode"
        text:
          nullable: true
          type: string
      type: object
    AltLabelMode:
      enum:
        - 1
        - 2
      format: int32
      type: integer
    DataItem:
      additionalProperties: false
      properties:
        ident:
          nullable: true
          type: string
        parentIdent:
          allOf:
            - $ref: "#/components/schemas/ParentRef"
          nullable: true
        values:
          items:
            type: string
          nullable: true
          type: array
      type: object
    HierarchicalInterview:
      additionalProperties: false
      properties:
        dataItems:
          items:
            $ref: "#/components/schemas/DataItem"
          nullable: true
          type: array
        hierarchicalInterviews:
          items:
            $ref: "#/components/schemas/HierarchicalInterview"
          nullable: true
          type: array
        ident:
          nullable: true
          type: string
        level:
          allOf:
            - $ref: "#/components/schemas/Level"
          nullable: true
      type: object
    Hierarchy:
      additionalProperties: false
      properties:
        ident:
          nullable: true
          type: string
        metadata:
          allOf:
            - $ref: "#/components/schemas/SurveyMetadataBase"
          nullable: true
        parent:
          allOf:
            - $ref: "#/components/schemas/ParentDetails"
          nullable: true
      type: object
    Interview:
      additionalProperties: false
      properties:
        dataItems:
          items:
            $ref: "#/components/schemas/DataItem"
          nullable: true
          type: array
        hierarchicalInterviews:
          items:
            $ref: "#/components/schemas/HierarchicalInterview"
          nullable: true
          type: array
        ident:
          nullable: true
          type: string
      type: object
    Label:
      additionalProperties: false
      properties:
        altLabels:
          items:
            $ref: "#/components/schemas/AltLabel"
          nullable: true
          type: array
        text:
          nullable: true
          type: string
      type: object
    Language:
      additionalProperties: false
      properties:
        ident:
          nullable: true
          type: string
        name:
          nullable: true
          type: string
        subLanguages:
          items:
            $ref: "#/components/schemas/Language"
          nullable: true
          type: array
      type: object
    Level:
      additionalProperties: false
      properties:
        ident:
          nullable: true
          type: string
      type: object
    ParentDetails:
      additionalProperties: false
      properties:
        level:
          nullable: true
          type: string
        linkVar:
          nullable: true
          type: string
        ordered:
          type: boolean
      type: object
    ParentRef:
      additionalProperties: false
      properties:
        parentValueIdent:
          nullable: true
          type: string
        parentVariableIdent:
          nullable: true
          type: string
      type: object
    ParentType:
      enum:
        - 1
        - 2
        - 3
      format: int32
      type: integer
    SurveyDetail:
      additionalProperties: false
      properties:
        id:
          format: uuid
          type: string
        name:
          nullable: true
          type: string
        title:
          nullable: true
          type: string
      type: object
    SurveyMetadata:
      additionalProperties: false
      properties:
        hierarchies:
          items:
            $ref: "#/components/schemas/Hierarchy"
          nullable: true
          type: array
        interviewCount:
          format: int32
          type: integer
        languages:
          items:
            $ref: "#/components/schemas/Language"
          nullable: true
          type: array
        name:
          nullable: true
          type: string
        title:
          nullable: true
          type: string
        variables:
          items:
            $ref: "#/components/schemas/Variable"
          nullable: true
          type: array
      type: object
    SurveyMetadataBase:
      additionalProperties: false
      properties:
        interviewCount:
          format: int32
          type: integer
        languages:
          items:
            $ref: "#/components/schemas/Language"
          nullable: true
          type: array
        name:
          nullable: true
          type: string
        title:
          nullable: true
          type: string
        variables:
          items:
            $ref: "#/components/schemas/Variable"
          nullable: true
          type: array
      type: object
    UseType:
      enum:
        - 1
        - 2
        - 3
        - 4
      format: int32
      type: integer
    Value:
      additionalProperties: false
      properties:
        code:
          nullable: true
          type: string
        ident:
          nullable: true
          type: string
        label:
          allOf:
            - $ref: "#/components/schemas/Label"
          nullable: true
        score:
          format: int32
          nullable: true
          type: integer
      type: object
    ValueRange:
      additionalProperties: false
      properties:
        from:
          nullable: true
          type: string
        to:
          nullable: true
          type: string
      type: object
    Variable:
      additionalProperties: false
      properties:
        ident:
          nullable: true
          type: string
        label:
          allOf:
            - $ref: "#/components/schemas/Label"
          nullable: true
        maxResponses:
          format: int32
          type: integer
        name:
          nullable: true
          type: string
        parentType:
          allOf:
            - $ref: "#/components/schemas/ParentType"
        questions:
          items:
            $ref: "#/components/schemas/Variable"
          nullable: true
          type: array
        type:
          allOf:
            - $ref: "#/components/schemas/VariableType"
        use:
          allOf:
            - $ref: "#/components/schemas/UseType"
        variableValues:
          allOf:
            - $ref: "#/components/schemas/VariableValues"
          nullable: true
      type: object
    VariableType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
      format: int32
      type: integer
    VariableValues:
      additionalProperties: false
      properties:
        range:
          allOf:
            - $ref: "#/components/schemas/ValueRange"
          nullable: true
        values:
          items:
            $ref: "#/components/schemas/Value"
          nullable: true
          type: array
      type: object
  securitySchemes:
    basic:
      description: Basic Authorization header using the Bearer scheme.
      in: header
      name: Authorization
      type: apiKey
