|
1 | 1 | openapi: 3.1.0 |
2 | 2 | info: |
3 | 3 | title: Trophy |
4 | | - version: '1.11.0' |
| 4 | + version: '1.12.0' |
5 | 5 | paths: |
6 | 6 | /achievements: |
7 | 7 | servers: |
@@ -1771,7 +1771,7 @@ paths: |
1771 | 1771 | periodStart: '2025-03-31' |
1772 | 1772 | periodEnd: '2025-04-05' |
1773 | 1773 | expires: '2025-04-12' |
1774 | | - rank: 5 |
| 1774 | + extended: '2025-04-03T14:30:00Z' |
1775 | 1775 | streakHistory: |
1776 | 1776 | - periodStart: '2025-03-30' |
1777 | 1777 | periodEnd: '2025-04-05' |
@@ -1906,115 +1906,6 @@ paths: |
1906 | 1906 | summary: Get the streak lengths of a list of users |
1907 | 1907 | security: |
1908 | 1908 | - 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: [] |
2018 | 1909 | /users/{id}/points/{key}: |
2019 | 1910 | servers: |
2020 | 1911 | - url: https://api.trophy.so/v1 |
@@ -4564,6 +4455,12 @@ components: |
4564 | 4455 | - $ref: '#/components/schemas/BaseStreakResponse' |
4565 | 4456 | - type: object |
4566 | 4457 | 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. |
4567 | 4464 | streakHistory: |
4568 | 4465 | type: array |
4569 | 4466 | description: >- |
@@ -4596,15 +4493,9 @@ components: |
4596 | 4493 | - periodStart |
4597 | 4494 | - periodEnd |
4598 | 4495 | - 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 |
4606 | 4496 | required: |
4607 | | - - rank |
| 4497 | + - extended |
| 4498 | + - streakHistory |
4608 | 4499 | PointsTrigger: |
4609 | 4500 | title: PointsTrigger |
4610 | 4501 | type: object |
@@ -5659,29 +5550,6 @@ components: |
5659 | 5550 | - badgeUrl |
5660 | 5551 | - maxPoints |
5661 | 5552 | - 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 |
5685 | 5553 | LeaderboardRanking: |
5686 | 5554 | title: LeaderboardRanking |
5687 | 5555 | type: object |
|
0 commit comments