Activities Widget
Request Details
| Item
|
Value
|
| Description
|
Returns the configured activity list for a widget and loyalty member. The response includes localized widget text when a locale is supplied. |
| Method
|
GET |
| Endpoint
|
https://[environment]api[client_id].crowdtwist.com/v2/widgets/activity/[widget_id]/[user_id]?api_key=[api_key]&id_type=[id_type]&locale=[locale] |
| Content Type
|
application/json |
Host and Path Parameters
| Parameter
|
Location / type
|
Required
|
Description
|
| environment |
host / string |
Yes |
Environment prefix used to construct the client-specific CrowdTwist API host. Deployment-specific value. |
| client_id |
host / string |
Yes |
Client identifier embedded in the CrowdTwist API host name. Deployment-specific value. |
| widget_id |
path / integer |
Yes |
Identifier of the activity widget to retrieve. |
| user_id |
path / string |
Yes |
Identifier for the loyalty member whose activity status is being returned. |
Request Query Parameters
| Parameter
|
Location / type
|
Required
|
Description
|
| api_key |
query / string |
Yes |
API key used for client identification and authentication. Treat as a secret and transmit only over HTTPS. |
| id_type |
query / string |
Yes |
Identifies the type of user_id. |
| locale |
query / string |
No |
Locale used to localize widget and activity text. |
Response Body
Top-Level Object
| Field
|
Type
|
Sample Value
|
Description
|
| details |
object |
{ "widget_title": "Activity List", ... } |
Localized presentation metadata for the widget. |
| items |
array |
[ { "activity_id": 410064666, ... } ] |
Ordered collection of activities returned for the member. |
details
| Field
|
Type
|
Sample Value
|
Description
|
| widget_title |
string |
Activity List |
Widget title (internal). |
| header_text |
string |
Gana puntos en el programa |
Localized header text displayed by the widget. |
items
Each array element represents an activity. The array is ordered using sort_order.
| Field
|
Type
|
Sample Value
|
Description
|
| sort_order |
integer |
1 |
Display order of the activity within the widget. |
| activity_type |
string (enum) |
custom |
Activity category. See Activity Type Values. |
| activity_id |
integer |
410064666 |
Unique identifier for the activity. |
| name |
string |
facebook link |
Internal activity name. |
| title |
string |
Visítanos en Facebook |
Localized activity title displayed to the member. |
| description |
string |
Visita nuestra página para ganar puntos hoy mismo. |
Localized activity description. |
| num_points |
integer |
5 |
Base points awarded for completing the activity. |
| bonus_points |
integer |
0 |
Additional bonus points associated with the activity. |
| img_url |
string (URI) |
https://de-cdn.crowdtwist.com/.../image.jpg |
URL of the activity image. |
| link |
string (URI) |
http://facebook.com/ourloyaltyprogram |
Destination link for the activity. |
| link_pointonclick |
boolean |
true |
Whether points are associated with clicking the activity link. |
| extra_data |
object |
{} |
Additional activity-specific data. Structure varies by activity type. |
| tags |
array |
[ { "id": 1, "name": "tag" } ] |
Tags assigned to the activity. |
| has_reached_freq_cap |
boolean |
true |
Whether the member has reached the activity frequency cap. |
| locked_by_tier |
boolean |
false |
Whether the activity is unavailable because of the member’s tier. |
| prereq_activity_id |
integer or null |
null |
Identifier of a prerequisite activity, if one is configured. |
Activity Type Values
| Value
|
Description
|
| standard |
Standard activity. |
| custom |
Custom activity. |
| code-redemption |
Code redemption activity. |
| survey-v1 |
Version 1 survey activity. |
| survey-v2 |
Version 2 survey activity. |
| poll |
Poll activity. |
| quiz |
Quiz activity. |
tags
| Field
|
Type
|
Sample Value
|
Description
|
| id |
integer |
1 |
Unique identifier for the tag. |
| name |
string |
tag |
Tag name. |
Sample Response Body
{
"details": {
"widget_title": "Activity List",
"header_text": "Gana puntos en el programa"
},
"items": [
{
"sort_order": 1,
"activity_type": "custom",
"activity_id": 410064666,
"name": "facebook link",
"title": "Visítanos en Facebook",
"description": "Visita nuestra página para ganar puntos hoy mismo.",
"num_points": 5,
"bonus_points": 0,
"img_url": "https://de-cdn.crowdtwist.com/img/v2/09257be631ba060a18fe73bd0dc5b716522a331f/w/h/0/image.jpg",
"link": "http://facebook.com/ourloyaltyprogram",
"link_pointonclick": true,
"extra_data": {},
"tags": [{ "id": 1, "name": "tag" }],
"has_reached_freq_cap": true,
"locked_by_tier": false,
"prereq_activity_id": null
}
]
}