Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/v1/get-user-game-leaderboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ const gameLeaderboards = await getUserGameLeaderboards(authorization, {
});
```

```kotlin [Kotlin]
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api

val response: NetworkResponse<GetUserGameLeaderboard.Response, ErrorResponse> = api.getUserGameLeaderboards(
gameId = 14402,
)

if (response is NetworkResponse.Success) {
// handle the data
val leaderboard: GetUserGameLeaderboard.Response = response.body

} else if (response is NetworkResponse.Error) {
// if the server returns an error it be found here
val errorResponse: ErrorResponse? = response.body

// if the api (locally) had an internal error, it'll be found here
val internalError: Throwable? = response.error
}
```

:::

## Response
Expand Down