{"_id":"54a0f407b9c6160b00b93de9","project":"5474381b59fade080004c920","editedParams":true,"githubsync":"","version":{"_id":"5474381b59fade080004c923","project":"5474381b59fade080004c920","__v":12,"createdAt":"2014-11-25T08:04:43.418Z","releaseDate":"2014-11-25T08:04:43.418Z","categories":["5474381b59fade080004c924","5474387f59fade080004c927","547d639078fd57080023cb81","549eb883b67f031400a5dc0e","54c87c8bab03760d00c8e4ec","54ca1480eb42170d0045d3c6","54ca1539dd5cf30d00c35135","560e634e59cb8d0d0015cce1","560e7bfc59cb8d0d0015ccfb","562531976ff1010d009b16f0","57c0378264ebf60e006886d9","57c037912588020e004b5c8e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"5474380459fade080004c91d","editedParams2":true,"parentDoc":null,"__v":17,"category":{"_id":"547d639078fd57080023cb81","__v":56,"pages":["547d6ab078fd57080023cb9c","547d6ad678fd57080023cba0","547d6cf12eaee50800ed11c5","547d70b678fd57080023cbaa","547d70e878fd57080023cbac","549eb4c87483040b001e9f79","549eb781b67f031400a5dc09","54a0e7cd58c49f0b00140c99","54a0e80b58c49f0b00140c9c","54a0e88cb9c6160b00b93dce","54a0e8ffb9c6160b00b93dd7","54a0ebd2b9c6160b00b93ddf","54a0ec11b9c6160b00b93de0","54a0ec62b9c6160b00b93de3","54a0ec8d58c49f0b00140c9f","54a0ecad58c49f0b00140ca1","54a0ecd958c49f0b00140ca2","54a0ed2cb9c6160b00b93de4","54a0ed5f58c49f0b00140ca3","54a0ed90b9c6160b00b93de7","54a0edc658c49f0b00140ca5","54a0eded58c49f0b00140ca8","54a0ee1b58c49f0b00140ca9","54a0ee8858c49f0b00140caa","54a0eed758c49f0b00140cb1","54a0f22058c49f0b00140cb9","54a0f25a58c49f0b00140cbd","54a0f2a858c49f0b00140cc0","54a0f2c458c49f0b00140cc1","54a0f31658c49f0b00140cc2","54a0f35b58c49f0b00140cc4","54a0f38558c49f0b00140cca","54a0f3b058c49f0b00140ccc","54a0f407b9c6160b00b93de9","54c63654f52b710d00d643d6","54c636cdf0320f0d00ac9b4e","54c636ef355b790d003c1223","54c63704f52b710d00d643d9","54c63726f52b710d00d643da","54c884cde317000d007c2841","54c88669ab03760d00c8e4ee","54c88704e317000d007c2844","54c89b40353f830d00678dc6","54c89bc119d1910d004feb3d","54c8b7b54574700d00f015ee","54c8bac50174630d00efa81a","54c8bd4e0174630d00efa81f","54cb3ffd61698d0d00baf765","5608ca086d8c440d000c79d1","5609326031beb60d001b65b0","560a273587b71d0d000d3a40","560a2d17ee8a910d0072f75d","56125a9a0157131900b45858","56125bf5ad4dab0d0064d288","56125f152afc821700a5b1f9","561b92d5868acd0d0043ad8a"],"project":"5474381b59fade080004c920","version":"5474381b59fade080004c923","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-02T07:00:32.464Z","from_sync":false,"order":1,"slug":"endpoints","title":"Endpoints"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-12-29T06:26:15.186Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","status":200,"language":"json","code":"[\n   {\n      \"name\":\"All\",\n      \"answers\":[\n         {\n            \"answerId\":6087403,\n            \"source\":6087403,\n            \"email\":\"timo.kallela:::at:::surveypal.com\",\n            \"language\":\"English\",\n            \"state\":\"complete\",\n            \"startDate\":\"2014-09-09T10:26:24+0000\",\n            \"endDate\":\"2014-09-09T10:26:34+0000\",\n            \"duration\":1,\n            \"meta\":[\n               {\n                  \"key\":\"kunta\",\n                  \"value\":\"Tampere\"\n               }\n            ],\n            \"elements\":[\n               {\n                  \"uuid\":\"0BD18F02-A6FB-4149-8E3E-FF0C0FC60B75\",\n                  \"name\":\"Choose from the following options:\",\n                  \"values\":[\n                     {\n                        \"index\":0\n                     }\n                  ]\n               },\n               {\n                  \"uuid\":\"DCF98286-B27E-4EB9-81CF-066A25361EB5\",\n                  \"name\":\"Enter your name\",\n                  \"values\":[\n                     {\n                        \"value\":\"Timo\"\n                     }\n                  ]\n               }\n            ]\n         }\n      ]\n   }\n]"}]},"settings":"","examples":{"codes":[]},"method":"get","auth":"required","params":[{"_id":"54a0e7cd58c49f0b00140c9a","ref":"","in":"path","required":true,"desc":"Target survey id","default":"","type":"int","name":"id"},{"_id":"560cd7e08753612100214279","ref":"","in":"query","required":false,"desc":"The preferred locale id what to use when getting element titles and texts. If locale id is not set then first survey locale will be used. http://developer.surveypal.com/v1.0/docs/locale-id-parameter","default":"","type":"string","name":"preferredLocaleId"},{"_id":"54a0f407b9c6160b00b93df0","ref":"","in":"query","required":false,"desc":"A JSON array of answer states. http://developer.surveypal.com/v1.0/docs/answer-state-parameter","default":"[complete]","type":"string","name":"answerState"},{"_id":"560cd7e08753612100214277","ref":"","in":"query","required":false,"desc":"A JSON array of channels. http://developer.surveypal.com/v1.0/docs/answer-source-parameter","default":"all","type":"string","name":"elements"},{"_id":"560cd7e08753612100214276","ref":"","in":"query","required":false,"desc":"The answer from date and time. http://developer.surveypal.com/docs/timestamp-parameter","default":"","type":"string","name":"from"},{"_id":"560cd7e08753612100214275","ref":"","in":"query","required":false,"desc":"The answer end date and time. http://developer.surveypal.com/docs/timestamp-parameter","default":"","type":"string","name":"to"},{"_id":"58074b1e6d47320f007a2f56","ref":"","in":"query","required":false,"desc":"The offset of first answer to return.","default":"","type":"int","name":"offset"},{"_id":"58074bb86d24211900953b68","ref":"","in":"query","required":false,"desc":"The maximum number of answers to return.","default":"","type":"int","name":"limit"},{"_id":"58074d356d47320f007a2f58","ref":"","in":"query","required":false,"desc":"","default":"RECIPIENTS","type":"string","name":"hierarchy"},{"_id":"580750866ddb35190060b12f","ref":"","in":"query","required":false,"desc":"Get answers including merged data. more info in /survey/{id}/merges","default":"","type":"string","name":"merge"},{"_id":"5891e0d7f4624a0f00083817","ref":"","in":"query","required":false,"desc":"Show element question ID","default":"false","type":"boolean","name":"useQuestionId"},{"_id":"5a21524397447e002a7359fa","ref":"","in":"query","required":false,"desc":"Enrich response with your own data or use placeholders. Currently there is only one placeholder surveyId. You can use formats <:surveyId:> and {id:<:surveyId:>} for userData values.","default":"","type":"string","name":"userData"}],"url":"/survey/:id/answers"},"isReference":false,"order":13,"body":"Returns filtered answers from the survey including actual answers for survey questions.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n  method: \\\"GET\\\",\\n  url: 'https://my.surveypal.com/api/rest/survey/:id/answers?preferredLocaleId=:preferredLocaleId&merge=:merge&answerState=:answerState&elements=:elements&from=:from&to=:to&offset=:offset&limit=:limit&hierarchy=:hierarchy',\\n  headers: {\\n    \\\"X-Auth-Token\\\": \\\"YOUR-TOKEN\\\",\\n    \\\"Accept\\\": \\\"application/json\\\"\\n  }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    },\n    {\n      \"code\": \"curl -i -X GET \\\\\\n   -H \\\"X-Auth-Token:YOUR-TOKEN\\\" \\\\\\n   -H \\\"Accept:application/json\\\" \\\\\\n 'https://my.surveypal.com/api/rest/survey/:id/answers?preferredLocaleId=:preferredLocaleId&merge=:merge&answerState=:answerState&elements=:elements&from=:from&to=:to&offset=:offset&limit=:limit&hierarchy=:hierarchy'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"List answers of the survey.","slug":"surveyidanswers","type":"endpoint","title":"/survey/{id}/answers"}

get/survey/{id}/answers

List answers of the survey.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
integer
Target survey id

Query Params

preferredLocaleId:
string
The preferred locale id what to use when getting element titles and texts. If locale id is not set then first survey locale will be used. http://developer.surveypal.com/v1.0/docs/locale-id-parameter
answerState:
string[complete]
A JSON array of answer states. http://developer.surveypal.com/v1.0/docs/answer-state-parameter
elements:
stringall
A JSON array of channels. http://developer.surveypal.com/v1.0/docs/answer-source-parameter
from:
string
The answer from date and time. http://developer.surveypal.com/docs/timestamp-parameter
to:
string
The answer end date and time. http://developer.surveypal.com/docs/timestamp-parameter
offset:
integer
The offset of first answer to return.
limit:
integer
The maximum number of answers to return.
hierarchy:
stringRECIPIENTS
merge:
string
Get answers including merged data. more info in /survey/{id}/merges
useQuestionId:
booleanfalse
Show element question ID
userData:
string
Enrich response with your own data or use placeholders. Currently there is only one placeholder surveyId. You can use formats <:surveyId:> and {id:<:surveyId:>} for userData values.

Result Format


Documentation

Returns filtered answers from the survey including actual answers for survey questions. [block:code] { "codes": [ { "code": "$.ajax({\n method: \"GET\",\n url: 'https://my.surveypal.com/api/rest/survey/:id/answers?preferredLocaleId=:preferredLocaleId&merge=:merge&answerState=:answerState&elements=:elements&from=:from&to=:to&offset=:offset&limit=:limit&hierarchy=:hierarchy',\n headers: {\n \"X-Auth-Token\": \"YOUR-TOKEN\",\n \"Accept\": \"application/json\"\n }\n});", "language": "javascript", "name": "jQuery" }, { "code": "curl -i -X GET \\\n -H \"X-Auth-Token:YOUR-TOKEN\" \\\n -H \"Accept:application/json\" \\\n 'https://my.surveypal.com/api/rest/survey/:id/answers?preferredLocaleId=:preferredLocaleId&merge=:merge&answerState=:answerState&elements=:elements&from=:from&to=:to&offset=:offset&limit=:limit&hierarchy=:hierarchy'", "language": "curl" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}