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

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

const response = await trophy.users.points("user-id", "points-system-key");
{
  "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
  "name": "XP",
  "description": null,
  "badgeUrl": null,
  "total": 100,
  "awards": [
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
      "awarded": 10,
      "date": "2021-01-01T00:00:00Z",
      "total": 100,
      "trigger": {
        "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
        "type": "metric",
        "points": 10,
        "metricName": "words written",
        "metricThreshold": 1000
      }
    }
  ]
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

ID of the user.

key
string
required

Key of the points system.

Query Parameters

awards
integer
default:10

The number of recent point awards to return.

Required range: 1 <= x <= 100

Response

Successful operation

id
string
required

The ID of the points system

name
string
required

The name of the points system

description
string | null
required

The description of the points system

badgeUrl
string | null
required

The URL of the badge image for the points system

total
number
required

The user's total points

awards
PointsAward · object[]
required

Array of trigger awards that added points.