Activity Stream


Request Details

Item Value
Description Returns a list of recent activities performed by all members of the program
Method GET
Endpoint https://api.crowdtwist.com/v2/stream?api_key=[API_KEY]&n=[n]


Request

Field Name Sample Value Required Format Notes
URL PARAMETERSnone
QUERY STRING PARAMETERS
api_key QWERTYUIOP Yes String  
n 10 Yes Interger The number of records to return (≤15)


Successful Response

Field Name Sample Value Required Format Notes
count 15 Yes Interger Number of records returned
Records {
“link_href”:”https://rewards.com/claim-points”,
“activity_image”:”https://website.com/image.jpg”,
“activity_text”:”redemeed a code.”,
“id”:301321041,
“username”:”16831123″,
“first_name”:”Leslie”,
“display_first_name”:true,
“completed_time”:1482933258,
“num_points”:1875,
“content_link”:null,
“content_title”:null,
“content_description”:null,
“content_img”:null,
“display_name”:”Leslie N.”
}
Yes Array Details of each recently completed activity.
Records Array
link_href https://rewards.com/claim-points No String The specified activity URL.
activity_image https://website.com/image.jpg Yes String The specified activity icon.
activity_text redemeed a code. Yes String The description of the specified activity completed.
id 301321041 Yes Interger Internal CrowdTwist activity id.
username 16831123 Yes String Username of the user who completed the specified activity.
first_name Leslie No String First name of the user who completed the specified activity.
display_first_name true yes String If the user should have their first name shown.
completed_time 1482933258 Yes UNIX Timestamp Time at which the user completed the specified activity.
num_points 1875 Yes Interger Number of points the user earned for completing the specified activity.
content_link null No String  
content_title null No String  
content_description null No String  
content_img null No String  
display_name Leslie N. No String Stylized version of the customer’s name to display.


Error Response

Field Name Sample Value Required Format Description
error param_error Yes String A machine readable code that describes the error.
message Missing n query 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 POST
'https://api.crowdtwist.com/v2/stream?api_key=QWERTYUIOP&n=2'
curl -X POST
'https://api.crowdtwist.com/v2/stream?api_key=QWERTYUIOP&n=2'


Sample Successful Response: Status Code 200

{
  "count": 2,
  "records": [
    {
      "link_href": null,
      "activity_image": "https://cdn.crowdtwist.com/img/v2/3935716fe11d3add1b6a31520a4e593da647b944/w/h/0/image.png",
      "activity_text": "completed My Features profile and earned 50 points.",
      "id": 301340534,
      "username": "16067644",
      "first_name": "Hanmei",
      "display_first_name": true,
      "completed_time": 1482939005,
      "num_points": 50,
      "content_link": null,
      "content_title": null,
      "content_description": null,
      "content_img": null,
      "display_name": "Hanmei Z."
    },
    {
      "link_href": null,
      "activity_image": "https://cdn.crowdtwist.com/img/v2/ca5495216b4c9c5770964f129786ca70361b1215/w/h/0/image.png",
      "activity_text": "clicked a link in an email message and earned 5 points.",
      "id": 301340432,
      "username": "14193435",
      "first_name": "Sara",
      "display_first_name": true,
      "completed_time": 1482938969,
      "num_points": 5,
      "content_link": null,
      "content_title": null,
      "content_description": null,
      "content_img": null,
      "display_name": "Sara V."
    }
  ]
}
{
  "count": 2,
  "records": [
    {
      "link_href": null,
      "activity_image": "https://cdn.crowdtwist.com/img/v2/3935716fe11d3add1b6a31520a4e593da647b944/w/h/0/image.png",
      "activity_text": "completed My Features profile and earned 50 points.",
      "id": 301340534,
      "username": "16067644",
      "first_name": "Hanmei",
      "display_first_name": true,
      "completed_time": 1482939005,
      "num_points": 50,
      "content_link": null,
      "content_title": null,
      "content_description": null,
      "content_img": null,
      "display_name": "Hanmei Z."
    },
    {
      "link_href": null,
      "activity_image": "https://cdn.crowdtwist.com/img/v2/ca5495216b4c9c5770964f129786ca70361b1215/w/h/0/image.png",
      "activity_text": "clicked a link in an email message and earned 5 points.",
      "id": 301340432,
      "username": "14193435",
      "first_name": "Sara",
      "display_first_name": true,
      "completed_time": 1482938969,
      "num_points": 5,
      "content_link": null,
      "content_title": null,
      "content_description": null,
      "content_img": null,
      "display_name": "Sara V."
    }
  ]
}

Sample Error Response: Status Code 400

{
  "error": "param_error",
  "message": "Missing n query parameter."
}
{
  "error": "param_error",
  "message": "Missing n query parameter."
}