User Activities
Request Details
Item | Value |
Description | This endpoint returns the details of a specific activity for a user. |
Method | GET |
Endpoint | https://[environment]api[client_id].crowdtwist.com/v2/users/[user_id]/activities?api_key=[api_key]&id_type=[id_type] |
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 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 PARAMETERS | ||||
api_key | QWERTYP | Yes | String | |
id_type | No | String | Type of ID being Sent: Options: – facebook_user_id – twitter_user_id – id (CrowdTwist ID) – default ID if id_type is not specified – third_party_id – username – mobile_phone_number |
Response
Response Body
Field Name | Sample Value | Required | Format | Description |
id | 216 | Yes | Integer | 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 | String | 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 |
date_start | 1508167798 | No | Integer | Start date of activity. |
date_end | 1510846197 | No | Ingeger | End date of activity. |
min_tier_id | 345 | No | Integer | 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 | Yes | Boolean | Indicates whether the activity is hidden or not to the user. |
is_locked_by_tier | false | Yes | Boolean | Indicates whether the activity is locked or not for the user. |
extra_data | See the EXTRA DATA OBJECT section. | No | Object | Extra data set via Control Center. |
campaigns | See the CAMPAIGNS ARRAY section. | No | Array | Returns the bonus points campaigns associated with the activity. |
EXTRA DATA OBJECT | ||||
Test | Test | No | String | Additional data as added. |
CAMPAIGNS ARRAY | ||||
title | Winter bonus points campaign | Yes | String | Returns the title of the bonus points campaign. |
multiplier | 3.0 | Yes | Decimal | Returns the multiplier of a bonus campaign. |
point_gift | 50 | Yes | Integer | Returns the point gift to be awarded. |
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 |
404 | page_not_found | User not found. |
Samples
Sample Request Body
Sample Response Body
Sample Error Response