User Survey Results


Request Details

Item Value
Description Returns a user’s survey response.
Method GET
Endpoint https://api.crowdtwist.com/v2/survey/[survey_id]/?api_key=[api_key]&user_id=[user_id]&id_type=[id_type]


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  
user_id alice@crowdtwist.com Yes String Unique ID of the user for whom activities will be returned:
Options:
  – Email Address
  – Facebook User ID
  – Twitter User ID
  – CrowdTwist ID
  – Third Party ID
  – Username
  – Mobile Phone Number
id_type email No String Type of ID being sent, defaults to ID if not specified.
Options:
  – email
  – facebook_user_id
  – twitter_user_id
  – id (CrowdTwist ID default if blank)
  – third_party_id
  – username
  – mobile_phone_number


Successful Response

Field Name Sample Value Required Format Description
id 45 No String CrowdTwist internal ID for response
value Drug Store No String Response value


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 PUT
https://api.crowdtwist.com/v2/survey/23/?api_key=QWERTYUIOP&user_id=alice@crowdtwist.com&id_type=email
curl -X PUT
https://api.crowdtwist.com/v2/survey/23/?api_key=QWERTYUIOP&user_id=alice@crowdtwist.com&id_type=email


Sample Successful Response: Status Code 200

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

Sample Error Response: Status Code 400

{
  "error": "param_error",
  "message": "Missing the #user_id parameter."
}
    
{
  "error": "param_error",
  "message": "Missing the #user_id parameter."
}