User Redemption History


Request Details

Item Value
Description Returns a list of rewards a user has redeemed.
Method GET
Endpoint https://api.crowdtwist.com/v2/users/[user_id]/redemption_history?api_key=[api_key]&id_type=[id_type]


Request

Field Name Sample Value Required Format Notes
URL PARAMETERS
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
QUERY STRING PARAMETERS
api_key QWERTYUIOP Yes String  
id_type email No String Type of ID being Sent:
Options:
– email
– facebook_user_id
– twitter_user_id
– id (CrowdTwist ID) – default ID if id_type is not specified
– third_party_id
– username
– mobile_phone_number


Successful Response

Field Name Sample Value Required Format Description
date_created 1425404945 Yes UNIX Timestamp Date user redeemed reward.
date_fulfilled 1425404945 No UNIX Timestamp Date reward fulfilled.
total_points_redeemed 100 Yes Integer Total points redeemed by user for reward.
ending_balance 15687 Yes Integer Total points remaining after redemption.
quantity 1 Yes Integer Number of reward redeemed.
shipping_first_name John No String If required by reward – first name to whom the reward will be shipped.
shipping_last_name Doe No String If required by reward – last name to whom the reward will be shipped.
shipping_street_address_1 25 1st Avenue No String If required by reward – street address of destination the reward will be shipped.
shipping_street_address_2 Apt 7C No String If required by reward – additional address info of destination the reward will be shipped.
shipping_country USA No String If required by reward – country of destination the reward will be shipped.
shipping_state NY No String If required by reward – state of destination the reward will be shipped.
shipping_city New York No String If required by reward – city of destination the reward will be shipped.
shipping_zip 10001 No String If required by reward – zip code of destination the reward will be shipped.
shipping_phone_number 2125551234 No String If required by reward – phone number of user redeeming reward.
tracking_number 1Z8234SD78DQ7 No String If physical reward – Tracking number of shipment.
codes {“wi4hsjd”} No Array If code reward – array of codes distributed for redemption.
digital_download http://www.someurl.com No String If digital download – url to download.
reward_id 678 Yes String Internal CrowdTwist activity id.
reward_title Tree T-shirt Yes String Reward redeemed.


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.
no_redemptions This user has not redeemed any rewards.


Sample Request

curl -X GET
https://api.crowdtwist.com/v2/users/alice@crowdtwist.com/redemption_history?api_key=QWERTYUIOP&id_type=email
curl -X GET
https://api.crowdtwist.com/v2/users/alice@crowdtwist.com/redemption_history?api_key=QWERTYUIOP&id_type=email


Sample Successful Response: Status Code 200

[{
    "date_created": 1425404945,
    "date_fulfilled": 1425404945,
    "total_points_redeemed": 100,
    "ending_balance": 15687,
    "quantity": 1,
    "codes": {
        "wi4hsjd"
    },
    "reward_id": "587",
    "reward_title": "10% off coupon"
},{
    "date_created": 1425404945,
    "date_fulfilled": 1425404945,
    "total_points_redeemed": 10000,
    "ending_balance": 14687,
    "quantity": 1,
    "shipping_first_name": "John",
    "shipping_last_name": "Doe",
    "shipping_street_address_1": "10 Fifth Avenue",
    "shipping_street_address_2": "Apartment 10G",
    "shipping_country": "US",
    "shipping_state": "NY",
    "shipping_city": "New York",
    "shipping_zip": "10001",
    "shipping_phone_number": "212-555-1234",
    "tracking_number": "1Z8234SD78DQ7",
    "reward_id": "360",
    "reward_title": "Free T-shirt"
}]
[{
    "date_created": 1425404945,
    "date_fulfilled": 1425404945,
    "total_points_redeemed": 100,
    "ending_balance": 15687,
    "quantity": 1,
    "codes": {
        "wi4hsjd"
    },
    "reward_id": "587",
    "reward_title": "10% off coupon"
},{
    "date_created": 1425404945,
    "date_fulfilled": 1425404945,
    "total_points_redeemed": 10000,
    "ending_balance": 14687,
    "quantity": 1,
    "shipping_first_name": "John",
    "shipping_last_name": "Doe",
    "shipping_street_address_1": "10 Fifth Avenue",
    "shipping_street_address_2": "Apartment 10G",
    "shipping_country": "US",
    "shipping_state": "NY",
    "shipping_city": "New York",
    "shipping_zip": "10001",
    "shipping_phone_number": "212-555-1234",
    "tracking_number": "1Z8234SD78DQ7",
    "reward_id": "360",
    "reward_title": "Free T-shirt"
}]

Sample Error Response: Status Code 400

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