User Activities


Request Details

Item Value
Description Returns the details of a specific activity for a user
Method GET
Endpoint https://api.crowdtwist.com/v2/users/[user_id]/activities?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
id 216 Yes String Internal CrowdTwist activity id.
title Sign in with Foursquare Yes String The title of the activity.
description Sign in with Foursquare Yes String The description of the activity.
num_points 2000 Yes Integer The number of points a user must redeem to be issued the reward.
image http://www.imagestorage.com/image Yes URL The activity icon.
category_id 2 No String ID of category activity is member of.
type_id 8 Yes String ID indicating the type of activity.
Options:
  1 = Facebook
  2 = Merchandise
  3 = Music
  5 = Tickets
  6 = Twitter
  7 = Your Site
  8 = Foursquare Check-in
  9 = Code Redemption
extra_data null No JSON Extra data set via Control Center
date_start 1508167798 No Date Start date of activity
date_end 1510846197 No Date End date of activity
min_tier_id null No String The minimum tier that a user needs to be at in order to perform this activity. List of ID values will be provided by the CrowdTwist team.
is_hidden_by_tier false No Boolean Indicates whether the activity is hidden or not to the user
is_locked_by_tier false No Boolean Indicates whether the activity is locked or not for the user


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_activities There are no rewards available to this user.


Sample Request

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


Sample Successful Response: Status Code 200

{
  "id": 410044811,
  "name": "read news",
  "title": "read news",
  "description": "Read news",
  "num_points": 123,
  "image": "https://cdn.crowdtwist.com/img/v2/7d1625e2cdde97c382a873c5c496984500d66a96/100/100/0/image.jpg",
  "category_id": "1",
  "category_name": "Share",
  "type_id": "1",
  "type_name": "Facebook",
  "activity_channel_id": null,
  "activity_channel_name": null,
  "freq_cap": "1",
  "freq_period_id": "2",
  "freq_period_name": "One calendar day",
  "freq_num_required_attempts": null,
  "redirect_url": null,
  "points_on_click": false,
  "action_tags": "ct_trck_news",
  "extra_data": null,
  "date_start": null,
  "date_end": null,
  "min_tier_id": null,
  "is_hidden_by_tier": false,
  "is_locked_by_tier": false,
  "public_title": "read news",
  "public_description": "Read news"
}
{
  "id": 410044811,
  "name": "read news",
  "title": "read news",
  "description": "Read news",
  "num_points": 123,
  "image": "https://cdn.crowdtwist.com/img/v2/7d1625e2cdde97c382a873c5c496984500d66a96/100/100/0/image.jpg",
  "category_id": "1",
  "category_name": "Share",
  "type_id": "1",
  "type_name": "Facebook",
  "activity_channel_id": null,
  "activity_channel_name": null,
  "freq_cap": "1",
  "freq_period_id": "2",
  "freq_period_name": "One calendar day",
  "freq_num_required_attempts": null,
  "redirect_url": null,
  "points_on_click": false,
  "action_tags": "ct_trck_news",
  "extra_data": null,
  "date_start": null,
  "date_end": null,
  "min_tier_id": null,
  "is_hidden_by_tier": false,
  "is_locked_by_tier": false,
  "public_title": "read news",
  "public_description": "Read news"
}