diff --git a/README.md b/README.md index 28903ba..03be496 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ Click the function names to open their complete docs on the docs site. ### Feed -- [`GetActiveClaims`](https://api-docs.retroachievements.org/v1/feed/get-active-claims.html) - Get all active set claims on the site. -- [`GetClaims`](https://api-docs.retroachievements.org/v1/feed/get-claims.html) - Get all claims of other kinds on the site. +- [`GetClaims`](https://api-docs.retroachievements.org/v1/feed/get-claims.html) - Retrieve achievement set development claims. +- [Active Claims](https://api-docs.retroachievements.org/v1/feed/get-active-claims.html) - Retrieve active achievement set development claims. - [`GetTopTenUsers`](https://api-docs.retroachievements.org/v1/feed/get-top-ten-users.html) - Get the list of top ten points earners. ### Event diff --git a/docs/v1/feed/get-active-claims.md b/docs/v1/feed/get-active-claims.md index 57be7d3..9175b17 100644 --- a/docs/v1/feed/get-active-claims.md +++ b/docs/v1/feed/get-active-claims.md @@ -1,49 +1,102 @@ -# getActiveClaims + + +# Active Claims A call to this endpoint returns information about all (1000 max) active set claims. -## Examples +[[toc]] + +## HTTP Request + +https://retroachievements.org/API/API_GetActiveClaims.php + +### Query Parameters + +| Name | Required? | Description | +| :--- | :-------- | :---------------- | +| `z` | Yes | Your username. | +| `y` | Yes | Your web API key. | -```ts -import { getActiveClaims } from "@retroachievements/api"; +## Client Library +::: code-group + +```ts [NodeJS] +import { buildAuthorization, getActiveClaims } from "@retroachievements/api"; + +// First, build your authorization object. +const userName = ""; +const webApiKey = ""; + +const authorization = buildAuthorization({ userName, webApiKey }); + +// Then, make the API call. const activeClaims = await getActiveClaims(authorization); ``` -## Returns +::: + +## Response -```json +::: code-group + +```json [HTTP Response] [ { - "id": 7044, - "user": "blendedsea", - "gameId": 19212, - "gameTitle": "SpongeBob SquarePants: Battle for Bikini Bottom", - "gameIcon": "/Images/059776.png", - "consoleName": "PlayStation 2", - "consoleId": 22, + "ID": 11246, + "User": "WanderingHeiho", + "GameID": 26971, + "GameTitle": "~Homebrew~ No Place To Hide", + "GameIcon": "/Images/084916.png", + "ConsoleID": 18, + "ConsoleName": "Nintendo DS", + "ClaimType": 0, + "SetType": 0, + "Status": 0, + "Extension": 0, + "Special": 0, + "Created": "2023-10-27 23:27:16", + "DoneTime": "2024-01-27 23:27:16", + "Updated": "2023-10-27 23:27:16", + "UserIsJrDev": 0, + "MinutesLeft": -41266 // Negative minutes left means the claim is expired. + } + // ... +] +``` + +```json [NodeJS] +[ + { + "id": 11246, + "user": "WanderingHeiho", + "gameId": 26971, + "gameTitle": "~Homebrew~ No Place To Hide", + "gameIcon": "/Images/084916.png", + "consoleId": 18, + "consoleName": "Nintendo DS", "claimType": 0, "setType": 0, "status": 0, "extension": 0, "special": 0, - "created": "2022-10-04 00:25:06", - "doneTime": "2023-01-04 00:25:06", - "updated": "2022-10-04 00:25:06", - "minutesLeft": 112523, - "userIsJrDev": false + "created": "2023-10-27 23:27:16", + "doneTime": "2024-01-27 23:27:16", + "updated": "2023-10-27 23:27:16", + "userIsJrDev": false, + "minutesLeft": -41268 // Negative minutes left means the claim is expired. } // ... ] ``` -## Parameters - -| Name | Type | Description | -| :-------------- | :------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------- | -| `authorization` | [`AuthObject`](/v1/data-models/auth-object) | An object that must contain a `userName` and a `webApiKey`. See [this page](/getting-started) for how to create this object. | +::: ## Source -[@retroachievements/api, getActiveClaims.ts](https://github.dev/RetroAchievements/api-js/blob/main/src/feed/getActiveClaims.ts) -[RAWeb, API_GetActiveClaims.php](https://github.dev/RetroAchievements/RAWeb/blob/master/public/API/API_GetActiveClaims.php) +| Repo | URL | +| :----------------------- | :---------------------------------------------------------------------------------------- | +| RetroAchievements/RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetActiveClaims.php | +| RetroAchievements/api-js | https://github.com/RetroAchievements/api-js/blob/main/src/feed/getActiveClaims.ts |