Survey Results


Request Details

Item Value
Description Returns response data for a survey
Method GET
Endpoint https://api.crowdtwist.com/v2/survey/[survey_id]/?api_key=[api_key]


Request

Field Name Sample Value Required Format Notes
URL PARAMETERS      
survey_id 23 Yes String ID of survey being retrieved
QUERY STRING PARAMETERS    
api_key QWERTYUIOP Yes String  
page 1 No String This endpoint uses pagination with a page size of 100. Specifying a page size will return a given subset of data. (i.e. page=1 returns items 1-100, page=2 return items 101-200)


Successful Response

Field Name Sample Value Required Format Description
id 45 No String  
value Drug Store No String  


Error Response

Field Name Sample Value Required Format Description
error param_error Yes String A machine readable code that describes the error.
message Missing the survey_id parameter Yes String A short, descriptive sentence detailing the error.


Error Response Codes

Error Message
input_error The input provided in invalid or formatted incorrectly.
internal_error Something went wrong on our end.
page_not_found The requested page does not exist or has been removed.
param_error A missing or invalid parameter is included in the request.
no_data The survey could not be found using the given Survey Id.


Sample Request

curl -X GET
https://api.crowdtwist.com/v2/survey/23/results?api_key=QWERTYUIOP
curl -X GET
https://api.crowdtwist.com/v2/survey/23/results?api_key=QWERTYUIOP


Sample Successful Response: Status Code 200

[  
   {  
      "id":"45",
      "value":"Drug Store"
   },
   {  
      "id":"47",
      "value":"Department Store"
   },
   {  
      "id":"56",
      "value":"Pet Store"
   }
]
[  
   {  
      "id":"45",
      "value":"Drug Store"
   },
   {  
      "id":"47",
      "value":"Department Store"
   },
   {  
      "id":"56",
      "value":"Pet Store"
   }
]

Sample Error Response: Status Code 400

{
  "error": "no_data",     
  "message": "Survey not found." 
}
{
	"error": "no_data",     
	"message": "Survey not found." 
}