Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: modernize page for GetActiveClaims #28

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
103 changes: 78 additions & 25 deletions docs/v1/feed/get-active-claims.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,102 @@
# getActiveClaims
<script setup>
import SampleRequest from '../../components/SampleRequest.vue';
</script>

# Active Claims

A call to this endpoint returns information about all (1000 max) active set claims.

## Examples
[[toc]]

## HTTP Request

<SampleRequest httpVerb="GET">https://retroachievements.org/API/API_GetActiveClaims.php</SampleRequest>

### 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 = "<your username on RA>";
const webApiKey = "<your web API key>";

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 |
Loading