Member Search


Request Details

Item Value
Description The Member Search API enables Customer service at POS terminals to look up members in a loyalty program.
Method POST
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/members?api_key= [api_key]&is_active=[is_active]
Content Type application/json


Request

Field Name Sample Value Required Format Notes
URL PARAMETERSnone
QUERY STRING PARAMETERS
api_key QWERTYUIOP Yes String  
is_active 1 No Boolean Returns users who are active or not active depending on the value of is_active. This is optional parameter. If not specified we will return only active by default, so essentially this should be used when you want to fetch inactive users

Request Body

Field Name Sample Value Required Format Notes
mobile_phone_number "5964464767" No String User's mobile phone number, this needs to be exact match for user to be returned
username "johnsmith" No String User name assigned to the user, this has to be an exact match.
first_name "John" No String User's first name, can be a begins with match.
last_name "Smith" No String User's last name, can be a begins with match.
email_address "johnsmith@g mail.com" No String User's email address, can be a begins with match.
third_party_id "AFSF454657" No String User's third party unique identifier, has to be exact match.
member_id 65456475 No Integer CrowdTwist internal user identifier.
checkin_code "081322" No String A temporary checkin code issued to the member via the Member Checkin API/widget.
postal_code 10010 No Integer User's postal code, exact match. Must be used together with one of the followings: email_address, first_name, last_name, mobile_phone_number.


Successful Response

Field Name Sample Value Format Description
Member Array     Returns an array of members matching the search criteria
member_id 5694678476 Integer CrowdTwist User ID
third_party_id "USER35440385" String Client's unique identifier
user_name "John4506849" String User name created by the user
email_address "johnsmith@gmail.com" String User's email address
first_name "John" String User's first name
last_name "Smith" String User's last name
phone_number "3425554444" String User's phone number
tier_level "Gold" String User's tier level
redeemable_points 49688 Integer Points that can be used for redemption
postal_code "10010" String Member's zip code if available
country "United States" String Member's registered country


Pagination

Parameter Sample Value Required Format Description
Page 3 No Integer Clients have the option to send request for a specific page number. If no page number is requested we will return the first page. If page requested is not a valid value we will return the first page. If page is out of range - Eg if page number is 0 or lesser, we will return empty members array and next page will have a link to page 1. If page number is exceeding the length of pages available we will return empty rewards array and return a link to the previous available page.
page_size 10 No Integer  


Sample Request

curl -X POST
https://api[client_id].crowdtwist.com/v2/members?api_key=[api_key]&page_size=[page_size]&is_active=2

{
   "mobile_phone_number":"5551224455",
   "username":"Johnsmith",
   "first_name":"John",
   "last_name":"Smith",
   "email_address":"youremail@email.com",
   "third_party_id":"AEV46464",
   "member_id":5348593589,
   "postal_code":"10010"
}


Sample Successful Response: Status Code 200

{
   "paging":{
      "total":133,
      "pages":14,
      "next_page":"https://api[client_id].crowdtwist.com/v2/members?page= [page_number]&page_size=[page_size]&api_key=",
      "prev_page":"https://api[client_id].crowdtwist.com/v2/members?page= [page_number]&page_size=[page_size]&api_key="
   },
   "members":[
      {
         "member_id":4535645756,
         "third_party_id":"6768668675",
         "user_name":"testuser",
         "email_address":"ab6856edfg75cx6378c@test.com",
         "first_name":"Test",
         "last_name":"User",
         "phone_number":"49859546784",
         "tier_level":"Gold",
         "redeemable_points":567575,
         "postal_code":"10010",
         "country":"United States"
      },
      {
         "member_id":45356545756,
         "third_party_id":"676457668675",
         "user_name":"testuser1",
         "email_address":"ab685675cx6378c@test.com",
         "phone_number":"498595784",
         "first_name":"Test1",
         "last_name":"User1",
         "tier_level":"Silver",
         "redeemable_points":567575,
         "postal_code":"10010",
         "country":"United States"
      }
   ]
}

Sample Error Response: Invalid API Key

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

Sample Error Response: When the request contains fields for which value is null or empty

{
"error":"input_error",
"message":"Your request contains a null or empty string search value"
}

Sample Error Response: When there is no search field specified in the body

{
"error":"input_error",
"message":"You need to specify at least one field"
}

Sample Error Response: When the data type is invalid

{
"error":"input_error",
"message":"[input_parameter] parameter must be a [data_type]."
}