-
Notifications
You must be signed in to change notification settings - Fork 0
Ratings
The api offers various ways to retrieve a rating.
This endpoint allows you to view the rating with the specified id.
This endpoint DOES require a valid 'Authorization' header with a Bearer-type token to be present in the request, for more information on authentication take a look at this page.
Ratings are retrieved using a GET request.
An example on how to request data from this endpoint can be seen below:
Request:
curl -X GET https://api.ratingtool.xyz/ratings/1 -H "Authorization: Bearer x9CFrvUbRAqb23TxLnDaAXUo6DKjwFAE.2579.376"
Response:
{
"rating": {
"id": 1,
"recipient": 338290696849195008,
"ratedBy": 374328434677121036,
"ratedIn": 969347293281157180,
"createdAt": "2022-06-01T13:03:58",
"weight": 100.0,
"message": ""
}
}
The weight in the response represents the amount of stars the user was rated. The amount of stars is weight % 20, so a weight of 100 is a 5 star rating and a weight of 20 would be 1 star.
This endpoint allows you to view the 5 latest ratings across the whole bot.
Ratings are retrieved using a GET request.
An example on how to request data from this endpoint can be seen below:
Request:
curl -X GET https://api.ratingtool.xyz/ratings/latest -H "Authorization: Bearer x9CFrvUbRAqb23TxLnDaAXUo6DKjwFAE.2579.376"
Response:
{
"ratings": [{
"id": 36,
"recipient": 338290696849195008,
"ratedBy": 804386907244462141,
"ratedIn": 969347293281157180,
"createdAt": "2022-06-04T13:47:05",
"weight": 20.0,
"message": "Api to slow.."
},
{
"id": 35,
"recipient": 338290696849195008,
"ratedBy": 374328434677121036,
"ratedIn": 969347293281157180,
"createdAt": "2022-06-04T13:46:06",
"weight": 20.0,
"message": "disturbing.."
},
{
"id": 34,
"recipient": 338290696849195008,
"ratedBy": 855793296155607051,
"ratedIn": 969347293281157180,
"createdAt": "2022-06-04T13:43:37",
"weight": 100.0,
"message": "Very nice"
},
{
"id": 33,
"recipient": 338290696849195008,
"ratedBy": 374328434677121036,
"ratedIn": 969347293281157180,
"createdAt": "2022-06-04T13:42:58",
"weight": 80.0,
"message": "meh."
},
{
"id": 1,
"recipient": 338290696849195008,
"ratedBy": 374328434677121036,
"ratedIn": 969347293281157180,
"createdAt": "2022-06-01T13:03:58",
"weight": 100.0,
"message": ""
}
]
}
This endpoint returns an array, containing 5 rating objects. For more info on rating objects take a look at the first endpoint on this page.
This endpoint allows you to view the latest ratings from a guild.
This endpoint DOES require a valid 'Authorization' header with a Bearer-type token to be present in the request, for more information on authentication take a look at this page.
You can also specify how many ratings you want to get per page by adding an amount parameter to the request, as well as the page via the page parameter, allowing for pagination over all the ratings in a guild. The amount parameter must be between 1 and 100 and will be set to the closest valid value.
Ratings are retrieved using a GET request.
An example on how to request data from this endpoint can be seen below:
Request:
curl -X GET https://api.ratingtool.xyz/ratings/969347293281157180/latest?amount=5&page=1 -H "Authorization: Bearer x9CFrvUbRAqb23TxLnDaAXUo6DKjwFAE.2579.376"
The response looks just like the normal /ratings/latest response.