Activity Stream

Request Details

Item Value
Description This endpoint returns a list of recent activities performed by all members of the program.
Method GET
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/stream?api_key=[API_KEY]&n=[n]
HTTP Header X-CT-Authorization = CTApiKey [API Key]
Note: There is a space between CTApiKey and the API Key value.
Content Type application/json

Request

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

Response

Response Body

Field Name Sample Value Required Format Description
count 15 Yes Interger Number of records returned.
Records See the RECORDS ARRAY section. 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 Integer Internal CrowdTwist activity id.
username axyz Yes String Username of the user who completed the specified activity.
first_name Leslie Yes String First name of the user who completed the specified activity.
display_first_name true Yes Boolean If the user should have their first name shown.
completed_time 1482933258 Yes Integer Time at which the user completed the specified activity. It is represented in Unix timestamp.
num_points 1875 Yes Integer Number of points the user earned for completing the specified activity.
content_link https://rewards.com/claim1-points No String  Link to the content.
content_title axyz No String  Title of the content.
content_description axyz No String  Description of the content.
content_img https://website.com/image2.jpg No String  Image of the content.
display_name Leslie N. No String Stylized version of the customer’s name to display.



Error Responses

Field Name Sample Value Required Format Description
error Field value is empty. Yes String This is a short form of the error.
message Value of field [fieldname] must not be empty. Yes String This is a detailed message around the error specifying, as specifically as possible, what the fields are that are missing or where exactly the error is.



Error Response Codes

Error Error Code Description Reason
Input Error 4xx Returned whenever the request is missing required fields, including situations in which the body is malformed (e.g. HTTP method not supported, receipt not found, etc.). – missing_data

– not_unique

– receipt_not_found

– invalid_amount

– invalid_currency

– invalid_date

– invalid_custom_field

– invalid
Server Error 5xx HTTP error status code is returned due to an error that occurred in the backend. – internal_error: unexpected error occurred in the CrowdTwist backend

– missing_field

– invalid_data

– not_configured: error occurs when an configuration has not been configured yet



Example Response Codes

Response Code Error Message
400 param_error Missing n query parameter.
403 invalid_auth Invalid access credentials.

Samples

Sample Request Body

curl -X GET 'https://api.crowdtwist.com/v2/stream?api_key=QWERTYUIOP&n=2'



Sample Response Body

{ "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

{ "error": "invalid_auth", "message": "Invalid access credentials." }