User Pending Points


Request Details

Item Value
Description Returns a list of a user’s completed activities and pending points (if available).
Method GET
Endpoint https://api.crowdtwist.com/v2/users/[user_id]/points/pending?api_key=[api_key]&id_type=[id_type]


Request

Field Name Sample Value Required Format Notes
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 STRING PARAMETERS
api_key QWERTYUIOP Yes String  
id_type email No String Type of ID being Sent:
Options:
– email
– facebook_user_id
– twitter_user_id
– id (CrowdTwist ID) – default ID if id_type is not specified
– third_party_id
– username
– mobile_phone_number


Successful Response

Field Name Sample Value Required Format Description
id 12345678 Yes   Internal CrowdTwist Member ID
total_points 9565 Yes   A member’s total lifetime points
redeemable_points 100 Yes   A member’s current redeemable points balance
num_points_purchased Watched A Video Yes   The description of the activity
Activities object        
name read email message Yes   name of the activity completed
num_points 25 Yes   number of points earned for completing the activity
notes null No    
date_created 1477036800 Yes   date activity was completed
pending object No   The pending object will appear in the response if a member has made a purchase, the client has pending points enabled, and the date the API is called is within the pending points period configured for the client.
Pending Object        
date_of_purchase 24-OCT-16 no   Date that member completed purchase
date_points_clear 24-NOV-16 no   Date that pending points clear
number_of_points 100 no   The number of points pending from purchase

Error Response

Field Name Sample Value Required Format Description
error param_error Yes String A machine readable code that describes the error.
message Missing the user_id parameter 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.
param_error A missing or invalid parameter is included in the request.
no_activities There are no rewards available to this user.

Sample Request

curl -X GET
https://api.crowdtwist.com/v2/users/alice@crowdtwist.com/points/pending?api_key=QWERTYUIOP&id_type=email
curl -X GET
https://api.crowdtwist.com/v2/users/alice@crowdtwist.com/points/pending?api_key=QWERTYUIOP&id_type=email

Sample Successful Response

{
  "id": 123456789,
  "total_points": 1300,
  "redeemable_points": 1300,
  "num_points_purchased": 0,
  "activities": [
    {
      "name": "user registration",
      "num_points": 500,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "added date of birth",
      "num_points": 100,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "joined email list",
      "num_points": 500,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "mobile phone added",
      "num_points": 100,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1475481600
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1476432000
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1476604800
    }
  ],
  "pending": [
    {
      "date_of_purchase": "24-OCT-16",
      "date_points_clear": "24-NOV-16",
      "number_of_points": "100"
    },
    {
      "date_of_purchase": "25-OCT-16",
      "date_points_clear": "25-NOV-16",
      "number_of_points": "100"
    }
  ],
  "fan_level": "Rookie"
}
{
  "id": 123456789,
  "total_points": 1300,
  "redeemable_points": 1300,
  "num_points_purchased": 0,
  "activities": [
    {
      "name": "user registration",
      "num_points": 500,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "added date of birth",
      "num_points": 100,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "joined email list",
      "num_points": 500,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "mobile phone added",
      "num_points": 100,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1475049600
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1475481600
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1476432000
    },
    {
      "name": "read email message",
      "num_points": 25,
      "notes": null,
      "date_created": 1476604800
    }
  ],
  "pending": [
    {
      "date_of_purchase": "24-OCT-16",
      "date_points_clear": "24-NOV-16",
      "number_of_points": "100"
    },
    {
      "date_of_purchase": "25-OCT-16",
      "date_points_clear": "25-NOV-16",
      "number_of_points": "100"
    }
  ],
  "fan_level": "Rookie"
}

Sample Error Response – No Points Are Pending
If no points are pending for the user, the pending array will result as null.

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