import { buildAuthorization, getComments } 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 depending on what kind of comments you want.// For comments on a user's wall, call the following:const userWallComments = await getComments(authorization, { identifier: "MaxMilyin",});// For comments on a game's wall, call the following:const gameWallComments = await getComments(authorization, { identifier: 14402, kind: "game",});// For comments on an achievement's wall, call the following:const achievementWallComments = await getComments(authorization, { identifier: 14402, kind: "achievement",});
Kotlin
val credentials = RetroCredentials("<username>", "<web api key>")val api: RetroInterface = RetroClient(credentials).api// get comments currently on user's wallval response: NetworkResponse<GetComments.Response, ErrorResponse> = api.getCommentsOnUserWall( username = "MaxMilyin",)// to get comments from a game's wall, use the following://// val response: NetworkResponse<GetComments.Response, ErrorResponse> = api.getCommentsOnGameWall(// gameId = 14402,// )// to get comments from an achievement's wall, use the following://// val response: NetworkResponse<GetComments.Response, ErrorResponse> = api.getCommentsOnAchievementWall(// achievementId = 14402,// )if (response is NetworkResponse.Success) { // handle the data val comments: GetComments.Response = response.body} else if (response is NetworkResponse.Error) { // if the server returns an error it be found here val errorResponse: ErrorResponse? = response.body // if the api (locally) had an internal error, it'll be found here val internalError: Throwable? = response.error}
Comments
A call to this endpoint returns comments of a specified kind: game, achievement, or user.
HTTP Request
https://retroachievements.org/API/API_GetComments.php?t=1&i=1
Query Parameters
yitcosortClient Library
Response
Source