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

[
    {
        "user_id": "11111266",
        "extra_data": null,
        "num_points": "250",
        "survey_responses": [
            {
                "id": "3690",
                "value": "3",
                "image_id": null,
                "image_url": null
            },
            {
                "id": "4768",
                "value": "1|4|5",
                "image_id": "59afe4e56214bea2ea44e9213d322b7e0407e53c|cbb6373ac9aa931769a25a0173bb9d21db7fc934|eee99ee267e988bb527ec2ee0e976a01138184ff",
                "image_url": "https://cdn.crowdtwist.com/img/v2/59afe4e56214bea2ea44e9213d322b7e0407e53c/100/100/0/image.jpg|https://cdn.crowdtwist.com/img/v2/cbb6373ac9aa931769a25a0173bb9d21db7fc934/100/100/0/image.jpg|https://cdn.crowdtwist.com/img/v2/eee99ee267e988bb527ec2ee0e976a01138184ff/100/100/0/image.jpg"
            },
            {
                "id": "4769",
                "value": "text input value",
                "image_id": null,
                "image_url": null
            }
        ]
    }
]
[
    {
        "user_id": "11111266",
        "extra_data": null,
        "num_points": "250",
        "survey_responses": [
            {
                "id": "3690",
                "value": "3",
                "image_id": null,
                "image_url": null
            },
            {
                "id": "4768",
                "value": "1|4|5",
                "image_id": "59afe4e56214bea2ea44e9213d322b7e0407e53c|cbb6373ac9aa931769a25a0173bb9d21db7fc934|eee99ee267e988bb527ec2ee0e976a01138184ff",
                "image_url": "https://cdn.crowdtwist.com/img/v2/59afe4e56214bea2ea44e9213d322b7e0407e53c/100/100/0/image.jpg|https://cdn.crowdtwist.com/img/v2/cbb6373ac9aa931769a25a0173bb9d21db7fc934/100/100/0/image.jpg|https://cdn.crowdtwist.com/img/v2/eee99ee267e988bb527ec2ee0e976a01138184ff/100/100/0/image.jpg"
            },
            {
                "id": "4769",
                "value": "text input value",
                "image_id": null,
                "image_url": null
            }
        ]
    }
]

Sample Error Response: Status Code 400

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