API Reference
TSAPI defines a set of GET requests to retrieve surveys, metadata, and interview data from any TSAPI-compliant system.
Base URL
All API requests are made to a base URL provided by the TSAPI host. For the demo server:
https://tsapi-demo.azurewebsites.netAuthentication
Authentication methods are defined by the host system. The surveys available to you will be determined by the internal details (e.g., authentication, permissions) of the survey system you're connecting to.
Response Format
All responses are returned in JSON format. The TSAPI Standard represents survey data and metadata in JSON, an open standard data interchange format.
Endpoints
/SurveysReturns a list of all surveys available to the caller. Use this to discover surveys and get their IDs for further API calls.
/Surveys/{id}/MetadataReturns the complete metadata for a specific survey, including variables, sections, value definitions, and supported languages.
/Surveys/{id}/InterviewsReturns interview (response) data for a specific survey. Supports filtering by date, completion status, specific variables, and pagination.
HTTP Status Codes
TSAPI endpoints return standard HTTP status codes:
| Code | Status | Description |
|---|---|---|
200 | OK | Request successful |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Authentication required |
404 | Not Found | Survey or resource not found |
500 | Server Error | Internal server error |
Future Extensions
TSAPI's GET Methods allow users to request data from a host system. Some processes require the ability to write back to that system.
The TSAPI Initiative is currently consulting on extending TSAPI to incorporate POST, PUT, and DELETE methods. However they are defined, these methods would be an optional extension of TSAPI Core.
Resources
- Swagger Documentation - Interactive API explorer
- Postman Collection - Ready-to-use request examples
- GitHub Repository - Source code and examples