Survey Responses - Survey Answers API

List all answers of a survey response

List all answers of a survey response with a specific ID.

GET /survey_responses/:id/survey_answers

Response

status: 200 OK
[
  {
    "id": 21,
    "survey_response": {
      "id": 182,
      "...": "..."
    },
    "survey_question": {
      "id": 29,
      "question": "What could we do to improve?",
      "nodeID": "..."
    },
    "text": "Serve coffee",
    "rating": null,
    "created_at": "2021-07-21T06:55:45-05:00",
    "updated_at": "2021-07-21T06:55:45-05:00",
    "nodeID": "..."
  },
  {
    "id": 22,
    "survey_response": {
      "id": 182,
      "...": "..."
    },
    "survey_question": {
      "id": 28,
      "question": "How do you rate us?",
      "nodeID": "..."
    },
    "text": null,
    "rating": 80,
    "created_at": "2021-07-21T06:55:50-05:00",
    "updated_at": "2021-07-21T06:55:50-05:00",
    "nodeID": "..."
  },
  "..."
]

The response contains these fields by default.

Collection Fields

By default the following fields will appear in collections of survey answers:

id survey_response survey_question text rating created_at updated_at

Obtain a different set of fields using the ?fields= parameter.

Get a single answer of a survey response

GET /survey_responses/:id/survey_answers/:answer_id

Response

status: 200 OK
{
  "attachments": [],
  "created_at": "2022-09-15T08:34:14-05:00",
  "id": 154,
  "rating": null,
  "source": null,
  "sourceID": null,
  "survey_question": {
    "id": 5,
    "question": "Rate us",
    "localized_question": "Rate us",
    "nodeID": "..."
  },
  "survey_response": {
    "id": 54,
    "year": 2022,
    "month": 9,
    "survey": {
      "id": 2,
      "name": "My Survey",
      "nodeID": "..."
    },
    "service": {
      "id": 31,
      "name": "Personal Computing",
      "localized_name": "Personal Computing",
      "nodeID": "...",
      "provider": {
        "id": 54,
        "name": "Widget Data Center, Internal IT",
        "account": {
          "id": "widget",
          "name": "Widget International"
        },
        "nodeID": "..."
      }
    },
    "nodeID": "..."
  },
  "text": "Yes please",
  "updated_at": "2022-09-15T08:34:14-05:00",
  "nodeID": "..."
}

The response contains these fields.

Add a answer to a survey response

Add a answer to a survey response with a specific ID.

POST /survey_responses/:id/survey_answers

When creating a new answer for a survey these fields are available.

Response

status: 200 OK
{
  "text": "Serve coffee!",
  "...": "..."
}

The response contains all fields of the created survey and is similar to the response in Get a single survey answer.

Update a answer of a survey response

Update a answer with a specific ID of a survey with a specific ID.

PATCH /survey_responses/:id/survey_answers/:answer_id

When updating an existing answer of a survey these fields are available.

Response

status: 200 OK
{
  "text": "Serve coffee!",
  "...": "..."
}

The response contains all fields of the created survey and is similar to the response in Get a single survey answer.

Fields

attachments
Readonly aggregated Attachments
created_at
Readonly datetime — The date and time at which the answer was created.
id
Readonly integer — The unique ID of the answer.
rating
Optional decimal — Only present for rating questions. The answer provided by the user.
source
Optional string (max 30) - See source
sourceID
Optional string (max 128) - See source
survey_question
Required reference to Question — Survey question this answer is for.
text
Optional text (max 64KB) — Only present for text questions. The answer provided by the user.
text_attachments
Writeonly attachments The attachments used in the Text field.
updated_at
Readonly datetime — The date and time of the last update of the answer. If the answer has no updates it contains the created_at value.