From 48c3d57f48ecf39f9ba7b0babc744375908c4f40 Mon Sep 17 00:00:00 2001 From: Wizard <55814558+official-wizard@users.noreply.github.com> Date: Sat, 20 Dec 2025 15:23:40 -0500 Subject: [PATCH] docs: add Kotlin example for API_GetGameProgression --- docs/v1/get-game-progression.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/v1/get-game-progression.md b/docs/v1/get-game-progression.md index b426f9e..1600da9 100644 --- a/docs/v1/get-game-progression.md +++ b/docs/v1/get-game-progression.md @@ -20,6 +20,33 @@ A call to this endpoint will retrieve information about the average time to unlo | `i` | Yes | The target game ID. | | `h` | | 1 to prefer players with more hardcore unlocks than non-hardcore unlocks. | +## Client Library + +::: code-group + +```kotlin [Kotlin] +val credentials = RetroCredentials("", "") +val api: RetroInterface = RetroClient(credentials).api + +val response: NetworkResponse = api.getGameProgression( + gameId = 228, +) + +if (response is NetworkResponse.Success) { + // handle the data + val gameProgression: GetGameProgression.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 ::: code-group