Get Survey
Get details of a survey.
Changes from v1.0
- The ‘displayName’ property is now called ‘name’.
- The ‘questionnaireTitle’ property is now called ‘title’.
- An ‘ownerId’ property has been added. This gives the owner’s id (GUID)
- An ‘ownerName’ property has been added. This is the owner’s user name.
- A ‘path’ property has been added. This is the path up to the survey as an array. E.g. A survey called ‘Survey001’ in folder ‘New Surveys’ in the user’s account will show as “Your work”, New Surveys” and the name will be ‘Survey001’.
- The interviewingState property has a different set of possible values. In v1 they were: “NotStarted”, “Live”, “Paused” and “Stopped”. In v2 they are: “NotStarted”, “Started”, “Paused”, “Stopped”, “TooManyRespondents” and “Unknown”.
Endpoint
Method | URL |
---|---|
GET | surveys/{surveyId} |
Gets the details of a specific survey identified by the surveyId path variable.
Parameters
Path parameters
Path parameter | Description |
---|---|
{surveyId} | The id of the survey. This is the survey GUID and not the Interview URL. |
Query string parameters
None
Sample Request
curl --location --request GET 'http://<servername>/snaponline/api/surveys/e819df57-0a01-4592-a7aa-8918dbe54e00' \
--header 'X-USERNAME: {USERNAME}' \
--header 'X-API-KEY: {APIKEY}' \
--header 'X-VERSION: 2.0'
(In the above code, replace {APIKEY} with your actual API key and {USERNAME} with your actual username.)
Sample Response
200 OK with body:
{
"id": "6834a5f1-46e5-4b12-9e0c-a38a3d9be12c",
"ownerId": "644f58a7-8526-4901-af7d-20969e5c68e4",
"ownerName": "sb4@titan.local",
"name": "APIv2 Example Survey",
"path": [
"Your work",
"APIv2"
],
"title": "APIv2 Example Survey",
"url": "https:// <servername>/snaponline/Home/Index/6834a5f1-46e5-4b12-9e0ca38a3d9be12c",
"interviewUrl": "https:// <servername>/interview/6834a5f1-46e5-4b12-9e0ca38a3d9be12c",
"interviewPreviewUrl": "https:// <servername>/interview/6834a5f1-46e5-4b12-
9e0c-a38a3d9be12c?preview=true",
"isPublished": true,
"interviewingState": "Live",
"numberOfResponses": 4,
"numberOfPartials": 0,
"responsesLastChanged": "2022-06-09T13:40:25.7"
}
Response Definitions
Response Item | Description | Data Type |
---|---|---|
id | The survey Id. | String: containing a GUID |
ownerId | The owner Id of the survey. | String: containing GUID |
ownerName | The owner name of the survey. | String |
name | The display name of the survey. | String |
path | The path to the survey. | List: containing strings |
title | The title used in the questionnaire. | String |
url | The url of the survey in Snap Online. | String |
interviewUrl | The interview url. | String |
interviewPreviewUrl | The preview interview url. | String |
isPublished | Whether the survey is published. | Boolean |
interviewingState | The current interviewing state. | String: “NotStarted”, “Started” – when live, “Paused”, “Stopped” – when closed, “TooManyRespondents”, “Unknown” |
numberOfResponses | The number of responses submitted. | Integer |
numberOfPartials | The number of partial responses. | Integer |
responsesLastChanged | The date and time that the list of responses for the survey was last changed, i.e. response added, deleted or edited. | String: containing DateTime |
HTTP Status Codes
- 200 OK
Other API calls
- Get Survey List
- Get Survey Variables
- Get Survey Variable
- Get Survey Responses
- Get User Info
- Get Participant List
- Get Participant
- Add Participant
- Update Participant
- Delete Participant
- Get Participants Subjects
- Get Participant Subject
- Add Participant Subject
- Update Participant Subject
- Delete Participant Subject