From 6932a58b03db3472bff0bd6458465dbf7804d580 Mon Sep 17 00:00:00 2001 From: Joshua Raphael Date: Sun, 19 Jan 2025 16:58:10 -0700 Subject: [PATCH 1/2] fix: update get-user-want-to-play-list to include js client call --- docs/v1/get-user-want-to-play-list.md | 37 ++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/docs/v1/get-user-want-to-play-list.md b/docs/v1/get-user-want-to-play-list.md index aca9268..8998f25 100644 --- a/docs/v1/get-user-want-to-play-list.md +++ b/docs/v1/get-user-want-to-play-list.md @@ -31,7 +31,22 @@ The user's Want to Play Games list page looks like: ::: code-group -```Kotlin +```ts [NodeJS] +import { buildAuthorization, getGameHashes } from "@retroachievements/api"; + +// First, build your authorization object. +const username = ""; +const webApiKey = ""; + +const authorization = buildAuthorization({ username, webApiKey }); + +// Then, make the API call. +const game = await getUserWantToPlayList(authorization, { + username: "MaxMilyin", +}); +``` + +```kotlin [Kotlin] val credentials = RetroCredentials("", "") val api: RetroInterface = RetroClient(credentials).api @@ -77,6 +92,25 @@ if (response is NetworkResponse.Success) { } ``` +```json [NodeJS] +{ + "count": 100, + "total": 1287, + "results": [ + { + "id": 20246, + "title": "~Hack~ Knuckles the Echidna in Sonic the Hedgehog", + "imageIcon": "/Images/074560.png", + "consoleID": 1, + "consoleName": "Genesis/Mega Drive", + "pointsTotal": 1500, + "achievementsPublished": 50 + } + // ... + ] +} +``` + ::: ## Source @@ -84,4 +118,5 @@ if (response is NetworkResponse.Success) { | Repo | URL | | :--------- | :------------------------------------------------------------------------------------------------------------------- | | RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetUserWantToPlayList.php | +| api-js | https://github.com/RetroAchievements/api-js/blob/main/src/user/getUserWantToPlayList.ts | | api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt | From 74b9c1ab59b756ea919a5d133ca54519ecdc06b4 Mon Sep 17 00:00:00 2001 From: Joshua Raphael Date: Sun, 19 Jan 2025 17:06:45 -0700 Subject: [PATCH 2/2] fix: getUserWantToPlayList import --- docs/v1/get-user-want-to-play-list.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/v1/get-user-want-to-play-list.md b/docs/v1/get-user-want-to-play-list.md index 8998f25..7db498b 100644 --- a/docs/v1/get-user-want-to-play-list.md +++ b/docs/v1/get-user-want-to-play-list.md @@ -32,7 +32,10 @@ The user's Want to Play Games list page looks like: ::: code-group ```ts [NodeJS] -import { buildAuthorization, getGameHashes } from "@retroachievements/api"; +import { + buildAuthorization, + getUserWantToPlayList, +} from "@retroachievements/api"; // First, build your authorization object. const username = "";