Points

The point object

Attributes

id integer
Unique identifier for points issued to a user.
quantity integer
Quantity of points issued to the user.
activity string
Activity that resulted in the points being issued. Can be one of: bonus, signup, share, referral, reward, friend_reward.
reason string
A reason for issuing these points. Populated when the activity is bonus.
user_id integer
Unique identifier of the user who was issued the points.
created_at timestamp
Time at which the points were issued to the user.

LIST points GET /api/v2/betas/{beta_id}/points

Receive a list of all Points.

Please Don't Poll — Instead, use our Webhooks feature, which lets us push data to you when points are earned or revoked. You can set up Webhooks from within the Prefinery UI. If you do decide to poll please note that we impose a rate limit of 60 requests per minute for this API endpoint.

Parameters

email optional
Get all points earned by a specific user.

Request

    
      curl -u api_key: https://api.prefinery.com/api/v2/betas/1/points.json?email=leonard@bigbangtheory.com
    
  

Response

      
  HTTP/1.1 200 OK
  
  [
    {
      "id": 1,
      "quantity": 2,
      "activity": "share",
      "reason": null,
      "user_id": 1,
      "created_at": "2020-08-15T13:15:01Z"
    },
    {
      "id": 2,
      "quantity": 10,
      "activity": "bonus",
      "reason": "VIP",
      "user_id": 1,
      "created_at": "2024-03-14T10:30:00Z"
    }
  ]
      
    

CREATE points POST /api/v2/betas/{beta_id}/points

Manually award bonus points to a user.

Parameters

email required
The user who will receive the points.
quantity required
The quantity of points being issued.
reason optional string
A reason for issuing these points, which will be displayed in your account on their profile page.

Request

    
    {
      "email": "leonard@bigbangtheory.com",
      "quantity": 10,
      "reason": "share on Facebook"
    }
    
  

Or, using curl:

    
      curl -u api_key: https://api.prefinery.com/api/v2/betas/1/points.json \
        -d email=leonard@bigbangtheory.com \
        -d quantity=10 \
        -d reason="share on Facebook"
    
  

Response

    
HTTP/1.1 201 Created
{
  "id": 1,
  "quantity": 10,
  "reason": "share on Facebook",
  "user_id": 1,
  "created_at": "2020-08-15T13:15:01Z"
}
    
  

Errors

Code Description
2801 A general error has occurred.
2802 Email is required.
2803 Email not found.
2804 Quantity is required.