Skip to content

Commit b42c1ad

Browse files
committed
Update OpenAPI spec
1 parent 2efb2e7 commit b42c1ad

2 files changed

Lines changed: 11 additions & 143 deletions

File tree

openapi/admin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.1.0
22
info:
33
title: Trophy
4-
version: '1.11.0'
4+
version: '1.12.0'
55
paths:
66
/attributes:
77
servers:

openapi/application.yml

Lines changed: 10 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.1.0
22
info:
33
title: Trophy
4-
version: '1.11.0'
4+
version: '1.12.0'
55
paths:
66
/achievements:
77
servers:
@@ -1771,7 +1771,7 @@ paths:
17711771
periodStart: '2025-03-31'
17721772
periodEnd: '2025-04-05'
17731773
expires: '2025-04-12'
1774-
rank: 5
1774+
extended: '2025-04-03T14:30:00Z'
17751775
streakHistory:
17761776
- periodStart: '2025-03-30'
17771777
periodEnd: '2025-04-05'
@@ -1906,115 +1906,6 @@ paths:
19061906
summary: Get the streak lengths of a list of users
19071907
security:
19081908
- ApiKeyAuth: []
1909-
/streaks/rankings:
1910-
servers:
1911-
- url: https://api.trophy.so/v1
1912-
description: Application API
1913-
parameters:
1914-
- $ref: '#/components/parameters/TenantId'
1915-
get:
1916-
description: Get the top users by streak length (active or longest).
1917-
operationId: streaks_rankings
1918-
x-fern-server-name: api
1919-
tags:
1920-
- Streaks
1921-
x-codeSamples:
1922-
- lang: javascript
1923-
source: |
1924-
import { TrophyApiClient } from '@trophyso/node';
1925-
1926-
const trophy = new TrophyApiClient({
1927-
apiKey: 'YOUR_API_KEY'
1928-
});
1929-
1930-
const response = await trophy.streaks.rankings({
1931-
limit: 20,
1932-
type: 'active'
1933-
});
1934-
- lang: python
1935-
source: |
1936-
from trophy import TrophyApi
1937-
1938-
client = TrophyApi(api_key='YOUR_API_KEY')
1939-
1940-
response = client.streaks.rankings(limit=20, type="active")
1941-
- lang: go
1942-
source: |
1943-
import (
1944-
"context"
1945-
1946-
api "github.com/trophyso/trophy-go"
1947-
trophyclient "github.com/trophyso/trophy-go/client"
1948-
"github.com/trophyso/trophy-go/option"
1949-
)
1950-
1951-
client := trophyclient.NewClient(
1952-
option.WithApiKey("YOUR_API_KEY"),
1953-
)
1954-
1955-
response, err := client.Streaks.Rankings(
1956-
context.TODO(),
1957-
&api.StreaksRankingsRequest{
1958-
Limit: api.Int(20),
1959-
Type: api.StreaksRankingsRequestTypeActive.Ptr(),
1960-
},
1961-
)
1962-
parameters:
1963-
- name: limit
1964-
in: query
1965-
description: Number of users to return. Must be between 1 and 100.
1966-
required: false
1967-
schema:
1968-
type: integer
1969-
minimum: 1
1970-
maximum: 100
1971-
default: 10
1972-
example: 20
1973-
- name: type
1974-
in: query
1975-
description: Whether to rank users by active streaks or longest streaks ever achieved.
1976-
required: false
1977-
schema:
1978-
type: string
1979-
enum: ['active', 'longest']
1980-
default: 'active'
1981-
example: 'active'
1982-
responses:
1983-
'200':
1984-
description: Successful operation
1985-
content:
1986-
application/json:
1987-
schema:
1988-
type: array
1989-
items:
1990-
$ref: '#/components/schemas/StreakRankingUser'
1991-
examples:
1992-
Successful operation:
1993-
value:
1994-
- userId: user-123
1995-
name: Alice Johnson
1996-
streakLength: 15
1997-
- userId: user-456
1998-
name: Bob Smith
1999-
streakLength: 12
2000-
- userId: user-789
2001-
name: Charlie Brown
2002-
streakLength: 8
2003-
'401':
2004-
description: 'Unauthorized'
2005-
content:
2006-
application/json:
2007-
schema:
2008-
$ref: '#/components/schemas/ErrorBody'
2009-
'422':
2010-
description: 'Unprocessible Entity'
2011-
content:
2012-
application/json:
2013-
schema:
2014-
$ref: '#/components/schemas/ErrorBody'
2015-
summary: Get top users by streak length
2016-
security:
2017-
- ApiKeyAuth: []
20181909
/users/{id}/points/{key}:
20191910
servers:
20201911
- url: https://api.trophy.so/v1
@@ -4564,6 +4455,12 @@ components:
45644455
- $ref: '#/components/schemas/BaseStreakResponse'
45654456
- type: object
45664457
properties:
4458+
extended:
4459+
type:
4460+
- string
4461+
- 'null'
4462+
format: date-time
4463+
description: The timestamp the streak was most recently extended. Null if the streak is not active.
45674464
streakHistory:
45684465
type: array
45694466
description: >-
@@ -4596,15 +4493,9 @@ components:
45964493
- periodStart
45974494
- periodEnd
45984495
- length
4599-
rank:
4600-
type:
4601-
- integer
4602-
- 'null'
4603-
description: Deprecated. The user's rank across all users. Null if the user has no active streak.
4604-
deprecated: true
4605-
example: 5
46064496
required:
4607-
- rank
4497+
- extended
4498+
- streakHistory
46084499
PointsTrigger:
46094500
title: PointsTrigger
46104501
type: object
@@ -5659,29 +5550,6 @@ components:
56595550
- badgeUrl
56605551
- maxPoints
56615552
- triggers
5662-
StreakRankingUser:
5663-
title: StreakRankingUser
5664-
type: object
5665-
description: A user with their streak length in the rankings.
5666-
properties:
5667-
userId:
5668-
type: string
5669-
description: The ID of the user.
5670-
example: user-123
5671-
name:
5672-
type:
5673-
- string
5674-
- 'null'
5675-
description: The name of the user. May be null if no name is set.
5676-
example: Alice Johnson
5677-
streakLength:
5678-
type: integer
5679-
description: The user's streak length (active or longest depending on query parameter).
5680-
example: 15
5681-
required:
5682-
- userId
5683-
- name
5684-
- streakLength
56855553
LeaderboardRanking:
56865554
title: LeaderboardRanking
56875555
type: object

0 commit comments

Comments
 (0)