Skip to content

Generate Answers CSV

Request the generation of a CSV export containing all quiz responses.


Overview

This endpoint initiates an asynchronous process to export all quiz answers to a CSV file. The export is queued for processing and will be made available once complete.

Method: POST
Endpoint:
/api/v1/namespaces/:namespaceId/quizzes/:quizId/csvExport

Requires administrative authentication.


Complete Export Flow

Exporting quiz answers to CSV is an asynchronous process that requires three steps:

  1. Request the export - POST to this endpoint to queue the export job
  2. Poll for completion - GET the quiz endpoint until csvExportStatus changes from "uploading" to "done"
  3. Download the file - Use the csvExportPath field from the quiz response to download the CSV file

Refer to the Quick Reference section in the Attune platform for a detailed breakdown of the contents of this file.


Request

Headers

http
x-api-key: {your_api_key}  # Required
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
namespaceIdstringNamespace unique ID
quizIdstringQuiz unique ID

Response

json
{
  "queued": true
}

The response indicates that the export process has been queued successfully. The actual CSV file will be generated asynchronously.


Polling for Export Status

After requesting the export, poll the Get Quiz endpoint to check the export status:

http
GET /api/v1/namespaces/:namespaceId/quizzes/:quizId

The quiz response will include:

FieldTypeDescription
csvExportStatusstringExport status: "uploading" or "done"
csvExportPathstringDownload URL for the CSV file (available when status is "done")

Example Polling Response

While processing:

json
{
  "id": "quizId",
  "csvExportStatus": "uploading",
  ...
}

When complete:

json
{
  "id": "quizId",
  "csvExportStatus": "done",
  "csvExportPath": "https://storage.example.com/exports/quiz-answers.csv",
  ...
}

Error Responses

  • 500 Internal Server Error – If the namespace or quiz does not exist
json
{
  "error": "namespace does not exist"
}
json
{
  "error": "quiz does not exist"
}

Alternative Export Options

If this endpoint does not meet your requirements, Attune also offers SFTP export with support for PGP encryption or your preferred encryption method. This is ideal for automated data integration, compliance requirements, or secure bulk transfers.

If neither option works for your use case, please contact us and we'll work with you to find a solution.