Skip to main content
GET
/
points
/
{key}
/
summary
JavaScript
import { TrophyApiClient } from '@trophyso/node';

const trophy = new TrophyApiClient({
  apiKey: 'YOUR_API_KEY'
});

const response = await trophy.points.summary("points-system-key", {
  userAttributes: "plan-type:premium,region:us-east"
});
[
  {
    "from": 0,
    "to": 0,
    "users": 5012
  },
  {
    "from": 1,
    "to": 100,
    "users": 1501
  },
  {
    "from": 101,
    "to": 200,
    "users": 1007
  },
  {
    "from": 201,
    "to": 300,
    "users": 584
  },
  {
    "from": 301,
    "to": 400,
    "users": 201
  },
  {
    "from": 401,
    "to": 500,
    "users": 102
  },
  {
    "from": 501,
    "to": 600,
    "users": 25
  },
  {
    "from": 601,
    "to": 700,
    "users": 0
  },
  {
    "from": 701,
    "to": 800,
    "users": 0
  },
  {
    "from": 801,
    "to": 900,
    "users": 0
  },
  {
    "from": 901,
    "to": 1000,
    "users": 0
  }
]

Authorizations

X-API-KEY
string
header
required

Path Parameters

key
string
required

Key of the points system.

Query Parameters

userAttributes
string

Optional colon-delimited user attribute filters in the format attribute:value,attribute:value. Only users matching ALL specified attributes will be included in the points breakdown.

Response

Successful operation

from
integer
required

The start of the points range. Inclusive.

to
integer
required

The end of the points range. Inclusive.

users
integer
required

The number of users in this points range.