Saltar al contenido principal
GET
/
points
/
{key}
JavaScript
import { TrophyApiClient } from '@trophyso/node';

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

const response = await trophy.points.system("points-system-key");
{
  "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
  "name": "XP System",
  "description": "Experience points for user engagement",
  "badgeUrl": "https://example.com/badge.png",
  "maxPoints": null,
  "triggers": [
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
      "type": "metric",
      "points": 10,
      "status": "active",
      "metricId": "0040fe51-6bce-4b44-b0ad-bddc4e123534",
      "metricName": "words written",
      "metricThreshold": 1000,
      "userAttributes": [
        {
          "key": "plan-type",
          "value": "premium"
        },
        {
          "key": "region",
          "value": "us-east"
        }
      ],
      "eventAttribute": {
        "key": "source",
        "value": "mobile-app"
      },
      "created": "2021-01-01T00:00:00Z",
      "updated": "2021-01-01T00:00:00Z"
    },
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123536",
      "type": "streak",
      "points": 10,
      "status": "active",
      "streakLengthThreshold": 7,
      "created": "2021-01-01T00:00:00Z",
      "updated": "2021-01-01T00:00:00Z"
    },
    {
      "id": "0040fe51-6bce-4b44-b0ad-bddc4e123535",
      "type": "achievement",
      "points": 50,
      "status": "active",
      "achievementId": "0040fe51-6bce-4b44-b0ad-bddc4e123535",
      "achievementName": "finish onboarding",
      "userAttributes": [
        {
          "key": "plan-type",
          "value": "premium"
        }
      ],
      "created": "2021-01-01T00:00:00Z",
      "updated": "2021-01-01T00:00:00Z"
    }
  ]
}
Límites de velocidad

Autorizaciones

X-API-KEY
string
header
requerido

Parámetros de ruta

key
string
requerido

Key of the points system.

Respuesta

Successful operation

id
string
requerido

The unique ID of the points system.

name
string
requerido

The name of the points system.

description
string | null
requerido

The description of the points system.

badgeUrl
string | null
requerido

The URL of the badge image for the points system, if one has been uploaded.

maxPoints
number | null
requerido

The maximum number of points a user can be awarded in this points system

triggers
PointsTriggerResponse · object[]
requerido

Array of active triggers for this points system.