User Profile
Request Details
Item | Value |
Description | The User Profile API call returns profile information for a loyalty member. The CrowdTwist platform integrates to systems that may have sensitivities with consuming and/or transmitting Personally Identifiable Information (pii). CrowdTwist now offers an optional query parameter called pii in the Get User Profile call. Setting the query parameter to false will retrieve Member data without exposing pii. |
Method | GET |
Endpoint | https://[environment]api[client_id].crowdtwist.com/v2/users/[user_id]?api_key=[api_key]&id_type=[id_type] |
Request
Field Name | Sample Value | Required | Format | Description |
URL PARAMETERS | ||||
user_id | 4353459891 | Yes | String | Unique ID for the user: – Third Party ID – CrowdTwist ID – Email Address – Mobile Phone Number – Facebook User ID – Twitter User ID – User Name |
QUERY PARAMETERS | ||||
api_key | ABCXYZIOP | Yes | String | API Key client sends for identification and authentication. |
id_type | abc@gmail.com | No | String | The id_type can be: – Third Party ID – CrowdTwist ID – Email Address – Mobile Phone Number – Facebook User ID – Twitter User ID – User Name When using the pii query parameter , the following ID types will be supported: – Third Party ID – CrowdTwist ID The following ID types will not be supported: – Email Address – Mobile Phone Number – Facebook User ID – Twitter User ID – User Name |
pii | false | No | Boolean | – If set to false, no pii would be returned.
– If pii is passed as &pii , but true or false is not set then it will be treated as false. – If set to true, pii would be returned. – If not added, pii would be returned. |
Response
Response Body
Field Name |
Sample Value |
Format |
Description |
id | 464565755 | Integer | Internal CrowdTwist member user_id. |
third_party_id |
A4364BX |
String |
User Third party ID. |
email_is_verified |
true |
Boolean |
Boolean which determines if user's email is verified. Verified email is required for reward redemption. |
is_active |
true |
Boolean |
Determines if user is active or inactive(disabled). |
first_name |
John |
String |
User's first name. Null when pii=false. |
middle_name |
Alister |
String |
User's middle name. Null when pii=false. |
last_name |
George |
String |
User's last name. Null when pii=false. |
username |
John435435 |
String |
Unique Username. Null when pii=false. |
gender |
Male |
String |
Gender corresponding to the gender_id. Null when pii=false |
gender_id |
2 |
String |
Internal CrowdTwist gender ID value. Use the ID values below to populate this field. Null when pii=false |
date_of_birth |
252558000 |
Timestamp |
User's DOB expressed as a timestamp. Null when pii=false. |
email_address |
john@abc.com |
String |
User's email address. Null when pii=false. |
mobile_phone_number |
6546550000 |
String |
User's mobile phone number. Null when pii=false. |
street_address_1 |
110 E 23rd st |
String |
User's street address. Null when pii=false. |
street_address_2 |
Floor 7 |
String |
User's street address. Null when pii=false. |
ca_province |
null |
String |
Canadian province provided, if user resider in Canada. Null when pii=false. |
state |
NY |
String |
State provided. Null when pii=false. |
city |
New York |
String |
City provided. Null when pii=false. |
postal_code |
10010 |
String |
Postal code provided. Null when pii=false. |
us_region |
Northeast |
String |
US Region provided. Null when pii=false. |
continent |
North America |
String |
Continent provided. Null when pii=false. |
country |
United States |
String |
Country provided. Null when pii=false. |
facebook_access_token |
- |
String |
Facebook access token. Null when pii=false. |
facebook_user_id |
- |
String |
Facebook user id. Null when pii=false. |
date_fb_token_expires |
- |
Timestamp |
Date when Facebook token expires. Null when pii=false. |
twitter_oauth_token |
- |
String |
Twitter oauth token. Null when pii=false. |
twitter_oauth_token_secret |
- |
String |
Twitter oauth token secret. Null when pii=false. |
pinterest_access_token |
- |
String |
Null when pii=false. |
pinterest_user_id |
- |
String |
Null when pii=false. |
inst_access_token |
- |
String |
Null when pii=false. |
inst_username |
- |
String |
Null when pii=false. |
inst_user_id |
- |
String |
Null when pii=false. |
password |
- |
String |
Always set to null. |
fan_level |
New Fan |
String |
Tier name. |
rank |
null |
Integer |
User's rank - This is going to be null as it's a legacy field. |
weekly_rank |
null |
Integer |
Weekly rank -This is going to be null as it's a legacy field. |
monthly_rank |
null |
Integer |
Monthly rank - This is going to be null as it's a legacy field. |
salt |
gergbh435dnmafsfs |
String |
Random data that is used as an additional input to a one-way function that hashes data, a password or passphrase. |
hash_algorithm_id |
1 |
String |
Hash algorithm ID for the user. |
password_generated |
1 |
String |
Indicates if password was generated by CrowdTwist. |
activity_stream_opt_in |
true |
Boolean |
Activity stream. |
extra_data |
null |
Object |
This is legacy not supported anymore, use custom_data instead. |
receive_email_updates |
true |
Boolean |
Email Updates. |
date_receive_email_opt_in |
252558001 |
Timestamp |
Date of receive email IN. |
date_receive_email_opt_out |
252558002 |
Timestamp |
Date of receive email OUT. |
total_points |
4399 |
Integer |
Lifetime points earned. |
redeemable_points |
3232 |
Integer |
Points that can be used for redemption. |
num_points_purchased |
100 |
Integer |
Num points purchased. |
store_id |
null |
String |
This is going to be null as it is a legacy field. |
date_last_login |
252578002 |
Timestamp |
Last date login. |
date_last_updated |
252568002 |
Timestamp |
Last date user was updated. |
date_created |
251568002 |
Timestamp |
Date user was created on the platform. |
lang_pref |
en |
String |
User's language preference. |
referral_url |
http://program.crowdtwist.com?_cts_=gD2S1W8P |
String |
Referral URL. |
sign_up_channel_id |
1 |
Integer |
Channel id of user sign-up. |
household_id |
1 |
Integer |
Household identifier. |
custom_data |
{
“register_id” : “1”, “cashier_id” : “2”, “loyalty_join_date” : “2018-10-31 10:00:00” } |
Object |
Custom Data JSON object (parameters are configurable by client). |
tier_info |
See the TIER INFO OBJECT section. |
Object |
Stores user's tier information. |
segments |
See the SEGMENTS OBJECT section. |
Object |
Stores user's linked segments. |
TIER INFO OBJECT | |||
title | Silver | String | Name of a tier. |
min_value | 4000 | String | Number of points required to attain or maintain a tier. |
max_value | 7999 | String | Number of points configured as the upper limit of a tier. |
image_url | http://crowdtwist-image.com | String | URL that links to the program’s tier image/icon. |
current_level |
{
|
object<level_data> | Object that includes data attributes relating to a users tier status. |
next_level |
{
|
object<level_data> | Level data of a user’s next tier. |
levels_above |
[
|
Array[level_data] | Array containing level data on all levels above a user’s current tier. (Will be null if user is in highest tier). |
levels_below |
[ |
Array[level_data] | Array containing level data of all levels below a user’s current tier. (Will be null if user is in lowest tier). |
date_assigned | 2017-02-08T02:37:44Z | String (ISO 8601 Format) | Date the member reached their current tier. |
date_reached | 2017-03-23T19:00:00Z | String | Date the member reached their current tier. This only changes when a member drops or jumps a tier. |
assigned_by_event | jump | String | The event that occurred when a member is assigned a tier (i.e. start, jump, maintain, drop, reset). |
is_maintenance_mode | true | Boolean | Boolean indicating whether the user’s points will count towards maintaining current level. |
expiration_date | 2019-02-06T05:00:00Z | String (ISO 8601 Format) | Date the member’s tier will expire (for both fixed and rolling). |
reset_date | 2018-02-06T05:00:00Z | String (ISO 8601 Format) | Date the member resets to 0 and enters maintenance (only for fixed timeframe, otherwise null). |
score_needed_to_reach | 4000 | Numeric | Number of points needed for a member to advance to next tier. |
score_needed_to_maintain | 4000 | Numeric | Number of points needed for a member to maintain current tier. |
days_until_expiration_date | 727 | Numeric | Number of days until a member’s tier expires if they do not maintain. |
days_until_reset_date | 362 | Numeric | Number of days until a member’s tier resets (only for fixed timeframe, otherwise null). |
timeframe_score | 1500 | Numeric | Cumulative score the member has earned in the current timeframe since the member last expired. Lifetime points: – Value is the same as “lifetime_points”. Fixed timeframe: – Value is calculated from start date to start date – i.e. for an annual timeframe it calculates the total points earned between 1/1/16-12/31/16. This score will reset to 0 at the end of the reset date. Rolling timeframe: -Value is calculated from when the user last expired i.e. if joined on 2/2/16 and jumped on 3/2/16 to gold, the timeframe score will be calculated until 3/2/17. |
tier_score | 250 | Numeric | The points earned while the member is in a tier. |
SEGMENTS OBJECT | |||
subscription_id | 43546 | Integer | Unique identifier for the segment. |
name | All males in New York | String | Name of the segment. |
date_entered |
2022-04-08T17:43:04.000Z |
Date | Date when the member enters the segment. |
Error Responses
Field Name | Sample Value | Required | Format | Description |
error | param_error | Yes | String | A machine readable code that describes the error. |
message | User does not exist | 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. |
page_not_found | The requested page does not exist or has been removed. |
Samples
Sample Request
Sample with pii query parameter not set
Sample Request
Sample Response Body
Sample with pii query parameter set to false
Sample Request
Sample Response Body
Sample Error Response: Status Code 400
Sample Error Response: Status Code 400 – Invalid API Key
Data segregation based on pii and no pii fields
pii data set to null | Available data |
first_name | id |
middle_name | third_party_id |
last_name | email_is_verified |
username | is_active |
gender | fan_level |
gender_id | rank - legacy always null |
date_of_birth | weekly_rank - legacy always null |
email_address | monthly_rank - legacy always null |
mobile_phone_number | salt |
street_address_1 | hash_algorithm_id |
street_address_2 | password_generated |
ca_province | activity_stream_opt_in |
state | extra_data - legacy always null |
city | receive_email_updates |
postal_code | date_receive_email_opt_in |
us_region | date_receive_email_opt_out |
continent | total_points |
country | redeemable_points |
facebook_access_token | num_points_purchased |
facebook_user_id | store_id - legacy always null |
date_fb_token_expires | date_last_login |
twitter_oauth_token | date_last_updated |
twitter_oauth_token_secret | date_created |
pinterest_access_token | lang_pref |
pinterest_user_id | referral_url |
inst_access_token | sign_up_channel_id |
inst_username | custom_data |
inst_user_id | tier_info |
password | segments |
household_id |