User Activity History (legacy)

Request Details

Item Value
Description Returns the list of activities a user has completed.
Method GET
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/users/[user_id]/activity_history?api_key=[api_key]&id_type=[id_type]

Request

Field Name Sample Value Required Format Description
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
page_size 10 No Integer If using pagination in request, the number of items per page.
Note: if used, must be used with page_number
page_number 1 No Integer If using pagination in request, the page number to be returned.
Note: if used, must be used with page_size

Response

Response Body

Field Name Sample Value Required Format Description
activity_id 225 Yes String CrowdTwist internal ID for activity.
date_created 1425404945 Yes String Date activity was recorded.
date_awarded 1425404945 Yes String Date activity was awarded.
name 225 Shared a link String Name of activity.
num_points 1000 Yes Integer Points earned for completing activity.
show_as_locked_by_tier 1 Yes Boolean
min_tier_id 1 No Integer Minimum user tier to complete activity
extra_data {
“url”: “http://www.someurl.com/shared.html”,
“message”: “Check this out!”,
“email”: “person@email.com”
}
No JSON Extra data set via User Activity Credit API.


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.
param_error A missing or invalid parameter is included in the request.
page_not_found The requested page does not exist or has been removed.

Samples

Sample Request Body

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



Sample Response Body

[ { "activity_id": "1006236", "name": "100 Points", "num_points": 100, "date_awarded": 1533729303, "date_created": 1533729303, "extra_data": { "test": "123|456|789" }, "min_tier_id": null, "show_as_locked_by_tier": false }, { "activity_id": "215", "name": "rewards redeemed", "num_points": 0, "date_awarded": 1531765873, "date_created": 1531765873, "extra_data": null, "min_tier_id": null, "show_as_locked_by_tier": false }, { "activity_id": "215", "name": "rewards redeemed", "num_points": 0, "date_awarded": 1530294576, "date_created": 1530294576, "extra_data": null, "min_tier_id": null, "show_as_locked_by_tier": false } ]

 

Sample Error Response

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