fetch answers

GET /api/sync/v1/surveys/answers

Operation id: getSurveyAssignmentAnswers

Description

This API will fetch answers that the assigned user or the user with task-view-all permission within same site as assignee has put in for the questions for a specific assignment of a to-do. The surveyId and assignment Id are mandatory fields as query parameters.

Permissions Required:

  1. Assignee of the to-do or have task-view-all permission within the same site

Tags: Survey APIs

Parameters

Query parameters

NameTypeRequiredDescription
assignmentIdinteger (int32)Yes
questionFilterTypearrayNo
surveyIdinteger (int32)Yes

Security

  • Bearer (http / bearer)
    • enter the client service token value.

Responses

200 — Answers fetched successfully

Content type: */*

400 — Bad Request

500 — Internal Server Error

Response models

200 — Answers fetched successfully

Content type: */*

Schema

PropertyTypeRequiredDescription
messagestringNo
statusstringNo
statusCodeinteger (int32)No
debugErrorMessagestringNo
messageCodestringNomessage codes
messageParamsarrayNo
dataobjectNo
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "SUCCESS",
        "FAIL",
        "BAD_REQUEST",
        "NO_CONTENT",
        "UNAUTHORIZED",
        "FORBIDDEN",
        "NOT_FOUND",
        "INTERNAL_SERVER_ERROR",
        "UNSUPPORTED_MEDIA_TYPE"
      ]
    },
    "statusCode": {
      "type": "integer",
      "format": "int32"
    },
    "debugErrorMessage": {
      "type": "string"
    },
    "messageCode": {
      "type": "string",
      "description": "message codes",
      "items": {
        "type": "string",
        "example": [
          "ERROR12-To-Do has expired.",
          "ERROR13-To-Do has been recalled.",
          "ERROR14-Complete all checklist items.",
          "ERROR15-Error updating status.",
          "ERROR16-Error fetching assignment.",
          "ERROR55-Error updating status.",
          "ERROR59-To-do is already completed by {name}",
          "ERROR75-To-Do has been Recalled.",
          "ERROR17-To-Do can not be reassigned as it has been completed.",
          "ERROR18-This To-Do is confidential and can not be reassigned.",
          "ERROR19-Error while reassigning.",
          "ERROR36-Current assignee's site id doesn't match",
          "ERROR20-This To-Do can not be recalled as it has not been launched.",
          "ERROR21-Error while recalling To-Do.",
          "ERROR35-Please select a reason type while recalling a task",
          "ERROR58-To-do can not be recalled."
        ]
      }
    },
    "messageParams": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "data": {
      "type": "object"
    }
  }
}