Skip to content

Commit 4052504

Browse files
authored
fix: update get-user-want-to-play-list to include js client call (#73)
1 parent 6ccd203 commit 4052504

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

docs/v1/get-user-want-to-play-list.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,25 @@ The user's Want to Play Games list page looks like:
3131

3232
::: code-group
3333

34-
```Kotlin
34+
```ts [NodeJS]
35+
import {
36+
buildAuthorization,
37+
getUserWantToPlayList,
38+
} from "@retroachievements/api";
39+
40+
// First, build your authorization object.
41+
const username = "<your username on RA>";
42+
const webApiKey = "<your web API key>";
43+
44+
const authorization = buildAuthorization({ username, webApiKey });
45+
46+
// Then, make the API call.
47+
const game = await getUserWantToPlayList(authorization, {
48+
username: "MaxMilyin",
49+
});
50+
```
51+
52+
```kotlin [Kotlin]
3553
val credentials = RetroCredentials("<username>", "<web api key>")
3654
val api: RetroInterface = RetroClient(credentials).api
3755

@@ -77,11 +95,31 @@ if (response is NetworkResponse.Success) {
7795
}
7896
```
7997

98+
```json [NodeJS]
99+
{
100+
"count": 100,
101+
"total": 1287,
102+
"results": [
103+
{
104+
"id": 20246,
105+
"title": "~Hack~ Knuckles the Echidna in Sonic the Hedgehog",
106+
"imageIcon": "/Images/074560.png",
107+
"consoleID": 1,
108+
"consoleName": "Genesis/Mega Drive",
109+
"pointsTotal": 1500,
110+
"achievementsPublished": 50
111+
}
112+
// ...
113+
]
114+
}
115+
```
116+
80117
:::
81118

82119
## Source
83120

84121
| Repo | URL |
85122
| :--------- | :------------------------------------------------------------------------------------------------------------------- |
86123
| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetUserWantToPlayList.php |
124+
| api-js | https://github.com/RetroAchievements/api-js/blob/main/src/user/getUserWantToPlayList.ts |
87125
| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |

0 commit comments

Comments
 (0)