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.
1 = Female
2 = Male
3 = Non-binary
4 = Other
5 = Prefer not to identify

Null when pii=false

gender_id

2

String

Internal CrowdTwist gender ID value. Use the ID values below to populate this field.
1 = Female
2 = Male
3 = Non-binary
4 = Other
5 = Prefer not to identify

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

{
"title": "Silver",
"min_value": 4000,
"max_value": 7999
}

object<level_data> Object that includes data attributes relating to a users tier status.
next_level

{
"title": "Gold",
"min_value": 8000,
"max_value": 9999
}

object<level_data> Level data of a user’s next tier.
levels_above

[
{
"title": "Gold",
"min_value": 8000,
"max_value": 9999
},
{
"title": "Platinum",
"min_value": 10000,
"max_value": null
}
]

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

[
{
"title": "Bronze",
"min_value": null,
"max_value": 3999
}
]

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

GET https://[environment]api[client_id].crowdtwist.com/v2/users/[user_id]/?api_key=[api_key]&id_type=[id_type]&pii=false


Sample with pii query parameter not set

Sample Request

Method: GET https://api.crowdtwist.com/v2/users/[user_id]?api_key=apikey&id_type=[id_type]


Sample Response Body

{ "id": 49261260, "first_name": "John", "middle_name": null, "last_name": "George", "date_of_birth": 252558000, "email_address": "johng@gmail.com", "email_is_verified": true, "username": "John453453", "mobile_phone_number": "4964567877", "third_party_id": null, "is_active": true, "gender_id": "2", "gender": "Male", "extra_data": null, "continent": "North America", "country": "United States", "us_region": "Northeast", "ca_province": null, "state": "NY", "city": "New York City", "street_address_1": "110 E 23rd st", "street_address_2": "Floor 7", "postal_code": "10010", "receive_email_updates": true, "date_receive_email_opt_in": null, "date_receive_email_opt_out": null, "total_points": 60220, "redeemable_points": 6553, "num_points_purchased": 0, "facebook_access_token": null, "facebook_user_id": null, "date_fb_token_expires": null, "twitter_oauth_token": "4011004576-dFk2DjJHUMKKUeuTzLNgrzDqkeK21DUX7jEgA", "twitter_oauth_token_secret": "cnAFU5iQpBsWdvh54ShLjOPeWGWnGbYQw3Mg8Kudz", "pinterest_access_token": null, "pinterest_user_id": null, "inst_access_token": null, "inst_username": null, "inst_user_id": null, "activity_stream_opt_in": true, "store_id": null, "date_last_login": 1570731404, "date_last_updated": 1654081424, "date_created": 1485958837, "password": null, "salt": null, "hash_algorithm_id": "5", "password_generated": "0", "lang_pref": null, "sign_up_channel_id": null, "referral_url": "http://rewards.crowdtwist.com?_cts_=NJm0eBIj", "rank": null, "weekly_rank": null, "monthly_rank": null, "fan_level": "LV 1", "tier_info": { "timeframe_score": 0, "tier_score": 0, "current_level": { "title": "LV 1", "min_value": null, "max_value": 199.9999, "image_url": "https://cdn.crowdtwist.com/img/v2/76f053754ce583e0f5dfcc87c55b2416417fa08f/w/h/0/image.jpg" }, "next_level": { "title": "LV 2", "min_value": 200, "max_value": 499.9999, "image_url": "https://cdn.crowdtwist.com/img/v2/4d1d46550fb148049a3a1b4956124e46c7adf1f8/w/h/0/image.jpg" }, "levels_above": [{ "title": "LV 2", "min_value": 200, "max_value": 499.9999, "image_url": "https://cdn.crowdtwist.com/img/v2/4d1d46550fb148049a3a1b4956124e46c7adf1f8/w/h/0/image.jpg" }, { "title": "LV 3", "min_value": 500, "max_value": 1200.4999, "image_url": "https://cdn.crowdtwist.com/img/v2/6d37349ce7462c7d3195c5847df8ae3258cfc5e7/w/h/0/image.jpg" }, { "title": "LV 4", "min_value": 1200.5, "max_value": null, "image_url": "https://cdn.crowdtwist.com/img/v2/6ec145a281d862d066cbe23b8590aabb9afa374c/w/h/0/image.png" } ], "levels_below": [], "date_assigned": "2022-06-13T22:52:35Z", "expiration_date": "2022-07-13T22:52:35Z", "reset_date": null, "score_needed_to_reach": 200, "score_needed_to_maintain": null, "days_until_expiration_date": 27, "days_until_reset_date": null, "is_maintenance_mode": true, "date_reached": "2017-02-01T14:20:37Z", "assigned_by_event": "maintain" }, "segments": [{ "subscription_id": 20, "name": "all male users on the platform", "date_entered": "2019-05-03T19:01:23.000Z" }, { "subscription_id": 622, "name": "All Male Segment take 2", "date_entered": "2019-05-03T17:55:37.000Z" } ], "custom_data": { "register_id": "1", "cashier_id": "2" }, "household_id": 4 }

Sample with pii query parameter set to false

Sample Request

Method: GET https://api.crowdtwist.com/v2/users/[user_id]?api_key=apikey&id_type=[id_type]&pii=false



Sample Response Body

{ "id": 54825473, "email_is_verified": true, "third_party_id": "Afg3453", "is_active": true, "first_name": null, "middle_name": null, "last_name": null, "username": null, "password": null, "gender_id": null, "gender": null, "date_of_birth": null, "email_address": null, "mobile_phone_number": null, "street_address_1": null, "street_address_2": null, "facebook_access_token": null, "facebook_user_id": null, "date_fb_token_expires": null, "twitter_oauth_token": null, "twitter_oauth_token_secret": null, "pinterest_access_token": null, "pinterest_user_id": null, "inst_access_token": null, "inst_username": null, "inst_user_id": null, "fan_level": "New Fan", "rank": null, "weekly_rank": null, "monthly_rank": null, "salt": "56gfdgbfnjreg", "hash_algorithm_id": "1", "password_generated": "0", "activity_stream_opt_in": true, "extra_data": null, "continent": null, "country": null, "us_region": null, "ca_province": null, "state": null, "city": null, "postal_code": null, "receive_email_updates": true, "date_receive_email_opt_in": 1520288789, "date_receive_email_opt_out": 1520289989, "total_points": 8847, "redeemable_points": 1727, "num_points_purchased": 0, "store_id": null, "date_last_login": 1520288789, "date_last_updated": 1543640435, "date_created": 1517346838, "lang_pref": "en", "referral_url": "http://rewards.crowdtwist.com?_cts_=hzMSHypM", "sign_up_channel_id": 1, "household_id":3, "custom_data": { "register_id": "1", "cashier_id": "2" }, "tier_info": { "timeframe_score": 0, "tier_score": 0, "current_level": { "title": "New Fan", "min_value": null, "max_value": 1999, "image_url": "https://cdn.crowdtwist.com/img/v2/68605c763e4217a07ddb77e5aa286e3e3958de90/w/h/0/image.jpg" }, "next_level": { "title": "Bronze", "min_value": 2000, "max_value": 9999, "image_url": "https://cdn.crowdtwist.com/img/v2/e96ad58e8b6e46bf3dbe2edd4a786c5af055beea/w/h/0/image.jpg" }, "levels_above": [{ "title": "Bronze", "min_value": 2000, "max_value": 9999, "image_url": "https://cdn.crowdtwist.com/img/v2/e96ad58e8b6e46bf3dbe2edd4a786c5af055beea/w/h/0/image.jpg" }, { "title": "Silver", "min_value": 10000, "max_value": 24999, "image_url": "https://cdn.crowdtwist.com/img/v2/37c1c15ec1c5c04a55661c26a0cbe158b04cbcc8/w/h/0/image.jpg" }, { "title": "Gold", "min_value": 25000, "max_value": 49999, "image_url": "https://cdn.crowdtwist.com/img/v2/01abd4556cd315acb72769bffb05763bc121b979/w/h/0/image.jpg" }, { "title": "Platinum", "min_value": 50000, "max_value": 99999, "image_url": "https://cdn.crowdtwist.com/img/v2/b9e64b763558aaabb077b4e9e6d3107122c1b15f/w/h/0/image.jpg" }, { "title": "Diamond", "min_value": 100000, "max_value": null, "image_url": "https://cdn.crowdtwist.com/img/v2/a0975a6dbcc87f222d305e03df27a228462174a1/w/h/0/image.jpg" } ], "levels_below": [], "date_assigned": "2018-10-30T21:13:58Z", "expiration_date": "2019-01-30T21:13:58Z", "reset_date": null, "score_needed_to_reach": 2000, "score_needed_to_maintain": null, "days_until_expiration_date": 20, "days_until_reset_date": null, "is_maintenance_mode": true, "date_reached": "2018-07-30T21:13:58Z", "assigned_by_event": "maintain" }, "segments": [{ "name": "Purchased $900 Product", "date_entered": "2018-03-09T14:56:39.000Z", "subscription_id": 20 }, { "name": "All male members", "date_entered": "2018-06-18T15:34:38.000Z", "subscription_id": 23 } ] }


Sample Error Response: Status Code 400

{ "error": "page_not_found", "message": "user does not exist." }


Sample Error Response: Status Code 400 – Invalid API Key

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


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