This endpoint returns the list of surveys (and their tokens) associated with a specific case. The token obtained is then used to query the responses of each survey through the endpoint Get Survey Responses.
Petition Details
- Base URL: {host}/ASMSAPI/
- Uri: /api/v9/item/{itemId}/{itemType}/surveys/answered
- Type: GET
-
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/item/{itemId}/{itemType}/surveys/answered
Parameters
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| itemId | Number | Yes | Identifier of the case on which the surveys are consulted |
| itemType | Number | Yes | Case Type Identifier – Incident = 1 - Problem = 2 - Change = 3 - Service requirement = 4 - Release = 13 |
Body of the petition
N/A
Examples of uri
- api/v9/item/10920/4/surveys/answered
Answer
{
"count": 2,
"list": [
{
"description": "Encuestas RQ",
"id": 3,
"name": "Encuestas RQ",
"title": "Encuestas RQ",
"token": "1077a718-fb20-463e-94d4-8581362269c9"
},
{
"description": "Encuestas RQ 2",
"id": 17,
"name": "Encuestas RQ 2",
"title": "Encuestas RQ 2",
"token": "b0f298f8-0766-40c0-b147-cfcef8cfb65e"
}
],
"result": true
}
⚐ Note: If the case has no associated surveys (or the
itemIddoes not exist), the answer is200 OKwith{"count":0,"list":null,"result":false}.
Response parameters
| Name | Data type | Description |
|---|---|---|
| count | Number | Number of surveys associated with the case |
| List | List | List of surveys associated with the case. It is null when there are no associated surveys |
| Id | Number | Survey ID |
| Name | Text | Survey Name |
| Description | Text | Description of the survey |
| title | Text | Survey Title |
| Token | Text | Unique token of the survey; used to query your responses using Get Survey Responses |
| result | Boolean | Indicates if surveys associated with the case were found |
Error messages
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | FailureHasSurvey - \r\nParameter name: itemType |