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 attributeKey:value,attributeKey:value. Only users matching ALL specified attributes will be included in the points breakdown.

Response

Successful operation

A list of eleven points ranges, with the first starting and ending at 0, and the remaining 10 being calculated as 10 equally sized ranges from 1 to the greatest number of points a user has, rounded up to the nearest power of 10.

from
number
required

The start of the points range. Inclusive.

to
number
required

The end of the points range. Inclusive.

users
number
required

The number of users in this points range.