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  
image_id 9105ba5937e340fb6bac58e2edd6359e5180b90b No String For answers with multiple images, values are pipe delimited.
image_url https://sample.crowdtwist.com/img/v2/9105b0b90b/100/100/0/image.jpg No String For answers with multiple images, values are pipe delimited.


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",
      "image_id": null,
      "image_url": null
   },
   {  
      "id":"47",
      "value":"Department Store",
        "image_id": "9105ba5937e340fb6bac58e2edd6359e5180b90b",
        "image_url": "https://sample.crowdtwist.com/img/v2/9105ba3456e340fb6bac58e2edd6359e5180b90b/100/100/0/image.jpg"
   },
   {  
      "id":"56",
      "value":"Pet Store",
      "image_id": "cbd6e51a8325283e3541b7d0e01bdf1275e8bb6b|44f25a7ef823952efc3d231459a2da9f0489d209",
        "image_url": "https://sample.crowdtwist.com/img/v2/cbd6e51a3456283e3541b7d0e01bdf1275e8bb6b/100/100/0/image.jpg|https://sample.crowdtwist.com/img/v2/34565a7ef823952efc3d231459a2da9f0489d209/100/100/0/image.jpg"
   }
]
[  
   {  
      "id":"45",
      "value":"Drug Store",
      "image_id": null,
      "image_url": null
   },
   {  
      "id":"47",
      "value":"Department Store",
        "image_id": "9105ba5937e340fb6bac58e2edd6359e5180b90b",
        "image_url": "https://sample.crowdtwist.com/img/v2/9105ba3456e340fb6bac58e2edd6359e5180b90b/100/100/0/image.jpg"
   },
   {  
      "id":"56",
      "value":"Pet Store",
      "image_id": "cbd6e51a8325283e3541b7d0e01bdf1275e8bb6b|44f25a7ef823952efc3d231459a2da9f0489d209",
        "image_url": "https://sample.crowdtwist.com/img/v2/cbd6e51a3456283e3541b7d0e01bdf1275e8bb6b/100/100/0/image.jpg|https://sample.crowdtwist.com/img/v2/34565a7ef823952efc3d231459a2da9f0489d209/100/100/0/image.jpg"
   }
]

Sample Error Response: Status Code 400

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