VoterGuideOS
API Specificationsquestionnaires

Get questionnaire by ID

Returns a single questionnaire by id. Authentication is optional for this read; if provided, the token is validated and may affect fields visible to the caller.

GET
/questionnaires/{id}

Path Parameters

id*string

Questionnaire id.

Match^[a-fA-F0-9]{24}$

Header Parameters

X-Organization-Id*string

The ID of the organization making the request.

Response Body

application/json

Questionnaire response.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

Provided authentication token is invalid.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

Questionnaire was not found.

TypeScript Definitions

Use the response body type in TypeScript.

curl -X GET "https://example.com/questionnaires/65d4f20f8f5a4d7e9a123456" \  -H "X-Organization-Id: org_123"
{
  "_id": "65d4f20f8f5a4d7e9a123456",
  "name": "string",
  "description": "string",
  "organization": "65d4f20f8f5a4d7e9a123456",
  "election": "string",
  "visibility": "public",
  "contentType": "questionnaire",
  "includeDefaultQuestions": true,
  "questions": [
    {
      "_id": "65d4f20f8f5a4d7e9a123456",
      "title": "string",
      "description": "string",
      "type": "text-long",
      "options": [
        "string"
      ],
      "required": true,
      "wordCountMax": 0,
      "visibility": "public",
      "archived": false,
      "default": false,
      "internalFieldId": "email",
      "mapsToField": "phone"
    }
  ],
  "createdByUser": "65d4f20f8f5a4d7e9a123456",
  "recentActivity": [
    {
      "user": "65d4f20f8f5a4d7e9a123456",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "races": [
    "65d4f20f8f5a4d7e9a123456"
  ],
  "statusByCandidate": [
    {
      "candidate": "65d4f20f8f5a4d7e9a123456",
      "race": "65d4f20f8f5a4d7e9a123456",
      "status": "not-started"
    }
  ],
  "analytics": {
    "numberCandidates": 0,
    "numberRaces": 0,
    "numberCandidatesNotStarted": 0,
    "numberCandidatesInProgress": 0,
    "numberCandidatesCompleted": 0,
    "numberCandidatesPublished": 0,
    "numberCandidatesSubmitted": 0
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}