Survey Details


Request Details

Item Value
Description Returns details on a specific survey.
Method GET
Endpoint https://api.crowdtwist.com/v2/survey?api_key=[apikey]&id=[id]&id_type=survey_id


Request

Field Name Sample Value Required Format Notes
URL PARAMETERS  – none
QUERY STRING PARAMETERS
api_key QWERTYUIOP Yes String
id 261 Yes String The id to be used to identify the survey.
id_type survey_id Yes String The type of ID sent.
Options:
1 = ID of the activity related to the survey.
2 = ID of the survey campaign.


Successful Response – Survey Object

Field Name Sample Value Required Format Description
id 261 Yes String Internal CrowdTwist survey id
name mon_20160418185902pmsurvey Yes String Name of the survey.
date_start 1460903400 Yes Integer Date campaign starts.
date_end null Yes Integer Date campaign ends.
num_points 1 Yes Integer Number of points a user receives for finishing survey.
questions Question Object Yes Array Question Object


Successful Response – Question Object

Field Name Sample Value Required Format Description
id 359 Yes String Internal CrowdTwist survey question id.
input_type_id 2 Yes String Id of type of question.
Options:
1 = Text
2 = Drop-down
value QA Test for survey creation? Yes String Question text
options No Array Question Option Object


Successful Response – Question Option Object

Field Name Sample Value Required Format Description
id 1020 No String Internal CrowdTwist survey question option id
value Yes No String Text of question option


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 user_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.


Sample Request

curl -X GET
https://api.crowdtwist.com/v2/survey?api_key=QWERTYUIOP&id=261&id_type=survey_id
curl -X GET
https://api.crowdtwist.com/v2/survey?api_key=QWERTYUIOP&id=261&id_type=survey_id


Sample Successful Response: Status Code 200

{
  "id": "261",
  "name": "mon_20160418185902pmsurvey",
  "title": "Mon_20160418185902PMSurvey",
  "description": "Mon_20160418185904PMSurvey",
  "date_start": "1460903400",
  "date_end": null,
  "num_points": "1",
  "questions": [
    {
      "id": "359",
      "input_type_id": "2",
      "value": "QA Test for survey creation?",
      "options": [
        {
          "id": "1020",
          "value": "Yes"
        },
        {
          "id": "1021",
          "value": "No"
        }
      ]
    }
  ]
}
{
  "id": "261",
  "name": "mon_20160418185902pmsurvey",
  "title": "Mon_20160418185902PMSurvey",
  "description": "Mon_20160418185904PMSurvey",
  "date_start": "1460903400",
  "date_end": null,
  "num_points": "1",
  "questions": [
    {
      "id": "359",
      "input_type_id": "2",
      "value": "QA Test for survey creation?",
      "options": [
        {
          "id": "1020",
          "value": "Yes"
        },
        {
          "id": "1021",
          "value": "No"
        }
      ]
    }
  ]
}

Sample Error Response: Status Code 400

{
  "error": "param_error",
  "message": "survey does not exist."
}
{
	"error": "param_error",
	"message": "survey does not exist."
}