diff --git a/docs/v1/achievements/get-achievement-unlocks.md b/docs/v1/achievements/get-achievement-unlocks.md index 0488839..d309e03 100644 --- a/docs/v1/achievements/get-achievement-unlocks.md +++ b/docs/v1/achievements/get-achievement-unlocks.md @@ -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 diff --git a/docs/v1/tickets/get-most-ticketed-games.md b/docs/v1/tickets/get-most-ticketed-games.md index c26528d..26b3d88 100644 --- a/docs/v1/tickets/get-most-ticketed-games.md +++ b/docs/v1/tickets/get-most-ticketed-games.md @@ -1,20 +1,74 @@ + + # 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 + +https://retroachievements.org/API/API_GetTicketData?f=1 + +### 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 = ""; +const webApiKey = ""; -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": [ { @@ -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 | diff --git a/docs/v1/tickets/get-ticket-by-id.md b/docs/v1/tickets/get-ticket-by-id.md index 699ea9b..90a157c 100644 --- a/docs/v1/tickets/get-ticket-by-id.md +++ b/docs/v1/tickets/get-ticket-by-id.md @@ -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 = ""; diff --git a/docs/v1/users/completion-progress.md b/docs/v1/users/completion-progress.md index 70cced6..e4679bf 100644 --- a/docs/v1/users/completion-progress.md +++ b/docs/v1/users/completion-progress.md @@ -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 diff --git a/docs/v1/users/recently-played-games.md b/docs/v1/users/recently-played-games.md index 7a14d5b..0e81154 100644 --- a/docs/v1/users/recently-played-games.md +++ b/docs/v1/users/recently-played-games.md @@ -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