User Activity History – Aggregate


Request Details

Item Value
Description Returns the list of active activities for a specific user. Activities are grouped in to categories “complete” and “incomplete”.
Method GET
Endpoint  


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
complete {
“name”: “user registration”,
“num_points”: 500,
“date_created”: 1338969600
}
Yes Array List of completed activities for specified user.
incomplete {
“id”: 341,
“name”: “added a comment”,
“num_points”: 25
}
Yes Array List of incompleted activities for specified user.
Complete/Incomplete Array
name user registration No String The name of the activity.
id 341 Yes String Internal CrowdTwist activity id.
num_points registration Yes Interger The number of points a user will earn for completing the specified activity.
date_created 1338969600 Yes String Date activity was recorded.


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.


Sample Request

curl -X GET
TBD
curl -X GET
TBD


Sample Successful Response: Status Code 200

{  
   "complete":[  
      {  
         "name":"user registration",
         "num_points":500,
         "date_created":1338969600
      },
      {  
         "name":"daily login",
         "num_points":5,
         "date_created":1338969600
      },
      {  
         "name":"joined email list",
         "num_points":500,
         "date_created":1338969600
      },
      {  
         "name":"added date of birth",
         "num_points":100,
         "date_created":1338969600
      }
   ],
   "incomplete":[  
      {  
         "id":341,
         "name":"added a comment",
         "num_points":25
      },
      {  
         "id":252,
         "name":"added gender",
         "num_points":100
      },
      {  
         "id":110,
         "name":"clicked link in email message",
         "num_points":75
      },
      {  
         "id":265,
         "name":"commented on a posting",
         "num_points":0
      },
      {  
         "id":334,
         "name":"emailed shopping bag",
         "num_points":50
      },
      {  
         "id":333,
         "name":"emailed wishlist",
         "num_points":75
      }
   ]
}
{  
   "complete":[  
      {  
         "name":"user registration",
         "num_points":500,
         "date_created":1338969600
      },
      {  
         "name":"daily login",
         "num_points":5,
         "date_created":1338969600
      },
      {  
         "name":"joined email list",
         "num_points":500,
         "date_created":1338969600
      },
      {  
         "name":"added date of birth",
         "num_points":100,
         "date_created":1338969600
      }
   ],
   "incomplete":[  
      {  
         "id":341,
         "name":"added a comment",
         "num_points":25
      },
      {  
         "id":252,
         "name":"added gender",
         "num_points":100
      },
      {  
         "id":110,
         "name":"clicked link in email message",
         "num_points":75
      },
      {  
         "id":265,
         "name":"commented on a posting",
         "num_points":0
      },
      {  
         "id":334,
         "name":"emailed shopping bag",
         "num_points":50
      },
      {  
         "id":333,
         "name":"emailed wishlist",
         "num_points":75
      }
   ]
}

Sample Error Response: Status Code 400

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