GET

/Surveys/{id}/Interviews

Returns interview (response) data for a specific survey. Supports filtering and pagination.

Large Datasets Warning

Without parameters, this endpoint returns ALL interviews. For large surveys, always use pagination parameters (Start, MaxLength).

Request

GET /Surveys/{id}/Interviews

Path Parameters

ParameterTypeDescription
idstring (GUID)The unique identifier of the survey

Query Parameters

ParameterTypeDescription
StartintegerStarting interview number (for pagination)
MaxLengthintegerMaximum number of interviews to return
CompleteOnlybooleanReturn only completed interviews (true/false)
Variablesarray[string]Filter to specific variable IDs
InterviewIdentsarray[string]Filter to specific interview IDs
DateFromstringStart date filter (YYYY-MM-DD)
DateTostringEnd date filter (YYYY-MM-DD)

Example Requests

Basic Request (All Interviews)

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews

With Pagination

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews?Start=901&MaxLength=100

Returns interviews 901-1000

Completed Interviews Only

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews?CompleteOnly=true

Specific Variables

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews?Variables=3&Variables=4&Variables=7

Returns data for variables 3, 4, and 7 only

Specific Interviews

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews?InterviewIdents=1&InterviewIdents=2&InterviewIdents=10

Date Range

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews?DateFrom=2021-10-05&DateTo=2021-11-28

Combined Parameters

https://tsapi-demo.azurewebsites.net/Surveys/1e6cb0a1-2289-4650-9148-9fc3e6e129b2/Interviews?MaxLength=50&CompleteOnly=true&DateFrom=2021-10-05&DateTo=2021-11-28

50 completed interviews from the specified date range

Response Structure

Returns an array of Interview objects:

[
  {
    "interviewId": "1",
    "date": "2021-01-01T03:09:57",
    "complete": true,
    "responses": [
      {
        "variableId": "2",
        "data": [
          { "value": "20210101" }
        ]
      },
      {
        "variableId": "4",
        "data": [
          { "value": "0", "state": "NotSelected" },
          { "value": "1", "state": "Selected" },
          { "value": "2", "state": "NotSelected" }
        ]
      }
    ]
  }
]

Response Fields

Interview Object

FieldTypeDescription
interviewIdstringUnique identifier for the interview
datestring (ISO 8601)Interview completion date/time
completebooleanWhether the interview was completed
responsesarrayArray of VariableData objects

VariableData Object

FieldTypeDescription
variableIdstringReferences the variable in metadata
dataarrayArray of VariableDataItem objects

VariableDataItem Object

FieldTypeDescription
valuestringThe response value (code for categorical)
statestring"Selected" or "NotSelected" (for categorical)
loopedVariableDataarrayNested variable data (for looped questions)

Data Structure by Variable Type

Single Response (single)

{
  "variableId": "4",
  "data": [
    { "value": "0", "state": "NotSelected" },
    { "value": "1", "state": "Selected" },
    { "value": "2", "state": "NotSelected" }
  ]
}

Multiple Response (multiple)

{
  "variableId": "5",
  "data": [
    { "value": "1", "state": "Selected" },
    { "value": "2", "state": "Selected" },
    { "value": "3", "state": "NotSelected" }
  ]
}

Quantity / Numeric

{
  "variableId": "3",
  "data": [
    { "value": "26" }
  ]
}

Date

{
  "variableId": "2",
  "data": [
    { "value": "20210101" }
  ]
}

Time

{
  "variableId": "3",
  "data": [
    { "value": "080000" }
  ]
}

Character / Text

{
  "variableId": "8",
  "data": [
    { "value": "Great service, would recommend!" }
  ]
}

Looped Data

For variables with nested loops, the loopedVariableData field contains responses to follow-up questions:

{
  "variableId": "7",
  "data": [
    {
      "value": "1",
      "state": "Selected",
      "loopedVariableData": [
        {
          "variableId": "8",
          "data": [
            {
              "value": "1",
              "state": "Selected",
              "loopedVariableData": [
                {
                  "variableId": "9",
                  "data": [
                    { "value": "1", "state": "Selected" },
                    { "value": "2", "state": "NotSelected" }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

This structure allows for complex survey designs where questions are asked repeatedly for each selected option in a parent question.