Skip to content

Commit

Permalink
docs: modernize page for get most ticketed games
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland committed Feb 25, 2024
1 parent 8dd9f92 commit 91a4597
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 39 deletions.
14 changes: 7 additions & 7 deletions docs/v1/achievements/get-achievement-unlocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ A call to this endpoint will retrieve a list of users who have earned an achieve

### Query Parameters

| Name | Required? | Description |
| :--- | :-------- | :------------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `a` | Yes | The target achievement ID. |
| `o` | | Offset, number of entries to skip (default: 0). |
| `c` | | Count, number of games to return (default: 50, max 500). |
| Name | Required? | Description |
| :--- | :-------- | :---------------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `a` | Yes | The target achievement ID. |
| `c` | | Count, number of records to return (default: 50, max: 500). |
| `o` | | Offset, number of entries to skip (default: 0). |

## Client Library

Expand Down
83 changes: 66 additions & 17 deletions docs/v1/tickets/get-most-ticketed-games.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,74 @@
<script setup>
import SampleRequest from '../../components/SampleRequest.vue';
</script>

# Get Most Ticketed Games

A call to `getTicketData()` in this manner will retrieve the games on the site with the highest count of opened achievement tickets.
A call to `API_GetTicketData` in this manner will retrieve the games on the site with the highest count of opened achievement tickets.

[[toc]]

## HTTP Request

<SampleRequest httpVerb="GET">https://retroachievements.org/API/API_GetTicketData?f=1</SampleRequest>

### Query Parameters

| Name | Required? | Description |
| :--- | :-------- | :---------------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `f` | Yes | Must be set to 1. |
| `c` | | Count, number of records to return (default: 10, max: 100). |
| `o` | | Offset, number of entries to skip (default: 0). |

## Client Library

::: code-group

## Examples
```ts [NodeJS]
import { buildAuthorization, getTicketData } from "@retroachievements/api";

```ts
import { getTicketData } from "@retroachievements/api";
// First, build your authorization object.
const userName = "<your username on RA>";
const webApiKey = "<your web API key>";

const mostTicketedGames = await getTicketData(authorization, {
const authorization = buildAuthorization({ userName, webApiKey });

// Then, make the API call.
const ticket = await getTicketData(authorization, {
isGettingMostTicketedGames: true,
});
```

## Returns
:::

## Response

::: code-group

```json [HTTP Response]
{
"MostReportedGames": [
{
"GameID": 9701,
"GameTitle": "Dead 'n' Furious | Touch the Dead",
"GameIcon": "\/Images\/070109.png",
"Console": "Nintendo DS",
"OpenTickets": 12
},
{
"GameID": 10438,
"GameTitle": "Crash Team Racing",
"GameIcon": "\/Images\/081550.png",
"Console": "PlayStation",
"OpenTickets": 11
},]
"URL": "https://retroachievements.org/ticketmanager.php?f=1"
}
```

```json
```json [NodeJS]
{
"mostReportedGames": [
{
Expand All @@ -37,16 +91,11 @@ const mostTicketedGames = await getTicketData(authorization, {
}
```

## 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. |
| `isGettingMostTicketedGames` | `true` | This value must be set to `true`. |
| `count` | `number?` | Optional. How many games to fetch. The default is 10. The max is 100. |
| `offset` | `number?` | Optional. How many games to skip. Useful for pagination. Zero-indexed. The default is 0. |
:::

## Source

[@retroachievements/api, getTicketData.ts](https://github.dev/RetroAchievements/api-js/blob/main/src/ticket/getTicketData.ts)
[RAWeb, API_GetTicketData.php](https://github.dev/RetroAchievements/RAWeb/blob/master/public/API/API_GetTicketData.php)
| Repo | URL |
| :----------------------- | :-------------------------------------------------------------------------------------- |
| RetroAchievements/RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetTicketData.php |
| RetroAchievements/api-js | https://github.com/RetroAchievements/api-js/blob/main/src/ticket/getTicketData.ts |
2 changes: 1 addition & 1 deletion docs/v1/tickets/get-ticket-by-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A call to `API_GetTicketData` in this manner will retrieve ticket metadata infor
::: code-group

```ts [NodeJS]
import { buildAuthorization, getUserSummary } from "@retroachievements/api";
import { buildAuthorization, getTicketData } from "@retroachievements/api";

// First, build your authorization object.
const userName = "<your username on RA>";
Expand Down
14 changes: 7 additions & 7 deletions docs/v1/users/completion-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ A user's completion progress can be found in several places, most prolifically o

### Query Parameters

| Name | Required? | Description |
| :--- | :-------- | :--------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `u` | Yes | The target username. |
| `c` | | How many records to return (default: 100, max: 500). |
| `o` | | Number of entries to skip (default: 0) |
| Name | Required? | Description |
| :--- | :-------- | :----------------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `u` | Yes | The target username. |
| `c` | | Count, number of records to return (default: 100, max: 500). |
| `o` | | Offset, number of entries to skip (default: 0). |

## Client Library

Expand Down
14 changes: 7 additions & 7 deletions docs/v1/users/recently-played-games.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ A call to this endpoint will retrieve a list of a target user's recently played

### Query Parameters

| Name | Required? | Description |
| :--- | :-------- | :------------------------------------------------------ |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `u` | Yes | The target username. |
| `o` | | Offset, number of entries to skip (default: 0). |
| `c` | | Count, number of games to return (default: 10, max 50). |
| Name | Required? | Description |
| :--- | :-------- | :--------------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `u` | Yes | The target username. |
| `c` | | Count, number of records to return (default: 10, max: 50). |
| `o` | | Offset, number of entries to skip (default: 0). |

## Client Library

Expand Down

0 comments on commit 91a4597

Please sign in to comment.