File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,33 @@ A call to this endpoint will retrieve information about the average time to unlo
2020| ` i ` | Yes | The target game ID. |
2121| ` h ` | | 1 to prefer players with more hardcore unlocks than non-hardcore unlocks. |
2222
23+ ## Client Library
24+
25+ ::: code-group
26+
27+ ``` kotlin [Kotlin]
28+ val credentials = RetroCredentials (" <username>" , " <web api key>" )
29+ val api: RetroInterface = RetroClient (credentials).api
30+
31+ val response: NetworkResponse <GetGameProgression .Response , ErrorResponse > = api.getGameProgression(
32+ gameId = 228 ,
33+ )
34+
35+ if (response is NetworkResponse .Success ) {
36+ // handle the data
37+ val gameProgression: GetGameProgression .Response = response.body
38+
39+ } else if (response is NetworkResponse .Error ) {
40+ // if the server returns an error it be found here
41+ val errorResponse: ErrorResponse ? = response.body
42+
43+ // if the api (locally) had an internal error, it'll be found here
44+ val internalError: Throwable ? = response.error
45+ }
46+ ```
47+
48+ :::
49+
2350## Response
2451
2552::: code-group
You can’t perform that action at this time.
0 commit comments