This endpoint returns the definition of a survey (questions and answer options), the general information of the survey and, optionally, the answers recorded by the user who answered it. The survey is identified by its token, obtained through the endpoint Get Survey Tokens.
Petition Details
- Base URL: {host}/ASMSAPI/
- Uri: /api/v9/survey/response/?token={token}
- Type: POST
-
Required headings:
- content-type: application/json
- X-Authorization: Bearer {token}
URL Description
- {host}: It represents the domain of the environment in which the API is located.
- ASMSAPI/: Fixed API prefix.
- URI: Specific endpoint for the request.
⚐ EXAMPLE URL:
https://{host}/ASMSAPI/api/v9/survey/response/?token={token}
Parameters
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| Token | Text | Yes | Token of the survey to be consulted, obtained by Get Survey Tokens |
Body of the petition
true
Answer
{
"Answers": [
{
"Id": 90,
"QuestionId": 7,
"ResponseChoiceId": 3,
"ResponseValue": null,
"token": "1077a718-fb20-463e-94d4-8581362269c9"
},
{
"Id": 92,
"QuestionId": 11,
"ResponseChoiceId": 0,
"ResponseValue": "Todo ok",
"token": "1077a718-fb20-463e-94d4-8581362269c9"
}
],
"DataConcept": "10920",
"Questions": [
{
"CreatedBy": 1,
"CreationDate": "/Date(1680215420753+0000)/",
"HelpText": "¿Esta de acuerdo con la solución del caso?",
"Id": 7,
"IsDeleted": false,
"IsIncludedToReport": false,
"IsJustificationMandatory": false,
"IsJustificationRequired": false,
"IsMandatory": false,
"JustificationLabel": null,
"MaxValue": 0,
"ModificationDate": null,
"ModifiedBy": 1,
"QuestionOrder": 1,
"QuestionTypeCode": 3,
"QuestionTypeId": 3,
"ResponseChoices": [
{
"Id": 3,
"IsChoiceMandatory": false,
"QuestionId": 7,
"ResponseOrder": 0,
"Text": "Si"
},
{
"Id": 4,
"IsChoiceMandatory": false,
"QuestionId": 7,
"ResponseOrder": 0,
"Text": "No"
}
],
"SurveyId": 3,
"Title": "¿Esta de acuerdo con la solución del caso?"
}
],
"Survey": {
"ApplicationId": 13,
"CategoryId": 8,
"CompanyId": null,
"ConceptId": null,
"CreatedBy": 1,
"CreationDate": "/Date(1680215311867+0000)/",
"DeactivationReason": null,
"Description": "Encuestas RQ",
"EndDate": null,
"ExitPage": null,
"Id": 3,
"IsActive": true,
"IsAnswered": true,
"IsDefaultSatisfactionLevel": false,
"ModificationDate": "/Date(1753289971717+0000)/",
"ModifiedBy": 1,
"Name": "Encuestas RQ",
"Observations": null,
"ProjectId": null,
"Questions": null,
"SatisfactionLevel": null,
"StartDate": null,
"Status": 2,
"Title": "Encuestas RQ"
}
}
Response parameters
| Name | Data type | Description |
|---|---|---|
| Answers | List | List of responses registered by the user for the survey |
| DataConcept | Text | Identifier of the case (item) on which the survey was answered |
| Questions | List | List of questions that make up the survey |
| Survey | Object | Survey Overview |
Answers
| Name | Data type | Description |
|---|---|---|
| Id | Number | Response ID |
| QuestionId | Number | Identifier of the question associated with the answer |
| ResponseChoiceId | Number | Identifier of the selected answer option (applies to selection questions) |
| ResponseValue | Text | Value of the answer as free text (applies to non-selection questions) |
| Token | Text | Survey Token |
Questions
| Name | Data type | Description |
|---|---|---|
| Id | Number | Question ID |
| HelpText | Text | Question text |
| Title | Text | Question title |
| QuestionOrder | Number | Order of the question within the survey |
| QuestionTypeId | Number | Question type identifier |
| QuestionTypeCode | Number | Question type code |
| SurveyId | Number | Survey ID to which the question belongs |
| ResponseChoices | List | List of available answer options for the question (see below) |
| IsMandatory | Boolean | Indicate whether the question is required |
| IsJustificationRequired | Boolean | Indicates whether the question requires justification |
| IsJustificationMandatory | Boolean | Indicate whether the justification of the question is mandatory |
| JustificationLabel | Text | Label displayed for justification field |
| IsIncludedToReport | Boolean | Indicates whether the question is included in reports |
| IsDeleted | Boolean | Indicate if the question was deleted |
| MaxValue | Number | Maximum allowed value for the answer, depending on the question type |
| CreatedBy | Number | Identifier of the user who created the question |
| ModifiedBy | Number | Identifier of the user who modified the question |
| CreationDate | Number (UNIX time in milliseconds) | Question creation date |
| ModificationDate | Number (UNIX time in milliseconds) | Question Last Modified Date |
ResponseChoices
| Name | Data type | Description |
|---|---|---|
| Id | Number | Answer Choice ID |
| QuestionId | Number | Identifier of the question to which the option belongs |
| Text | Text | Answer option text |
| ResponseOrder | Number | Order of the option within the question |
| IsChoiceMandatory | Boolean | Indicates whether selecting this option requires a justification |
Survey
| Name | Data type | Description |
|---|---|---|
| Id | Number | Survey ID |
| Name | Text | Survey Name |
| Title | Text | Survey Title |
| Description | Text | Description of the survey |
| IsActive | Boolean | Indicates whether the survey is active |
| IsAnswered | Boolean | Indicates if the survey has already been answered |
| Status | Number | Survey status identifier |
| ApplicationId | Number | Identifier of the app to which the survey belongs |
| CategoryId | Number | Survey category identifier |
| CompanyId | Number | Identifier of the company associated with the survey, if applicable |
| ConceptId | Number | Identifier of the concept associated with the survey, if applicable |
| ProjectId | Number | Project ID associated with the survey, if applicable |
| IsDefaultSatisfactionLevel | Boolean | Indicates whether the survey uses the default satisfaction level |
| SatisfactionLevel | Number | Satisfaction level configured for the survey, if applicable |
| Observations | Text | Observations recorded on the survey |
| ExitPage | Text | Redirect URL at survey completion, if configured |
| StartDate | Number (UNIX time in milliseconds) | Survey Effective Date |
| EndDate | Number (UNIX time in milliseconds) | Survey End Date |
| DeactivationReason | Text | Reason for deactivating the survey, if applicable |
| CreatedBy | Number | Identifier of the user who created the survey |
| ModifiedBy | Number | Identifier of the user who modified the survey |
| CreationDate | Number (UNIX time in milliseconds) | Survey creation date |
| ModificationDate | Number (UNIX time in milliseconds) | Survey Last Modified Date |
| Questions | List | It is not populated in this answer (questions are returned at the root level Questions) |
Error messages
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | ERROR_GETTING_SURVEY (non-existent or invalid token) |
| 400 | BadRequest | EmptyValue - \r\nParameter name: token (token not sent) |
| 400 | BadRequest | SURVEY_HAS_ALREADY_BEEN_ANSWERED (was sent false as a body and the survey has already been answered) |