diff --git a/docs/v1/get-user-game-leaderboards.md b/docs/v1/get-user-game-leaderboards.md index 0b28418..4b5cc58 100644 --- a/docs/v1/get-user-game-leaderboards.md +++ b/docs/v1/get-user-game-leaderboards.md @@ -54,6 +54,27 @@ const gameLeaderboards = await getUserGameLeaderboards(authorization, { }); ``` +```kotlin [Kotlin] +val credentials = RetroCredentials("", "") +val api: RetroInterface = RetroClient(credentials).api + +val response: NetworkResponse = 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