Skip to content

Getting a category and its informations

Théandre Bourry edited this page Jun 24, 2023 · 1 revision

To get the informations of a category, you should make a call to the route

GET - api/category/{categoryName}

This will try to read a file named {categoryName}.category in the server's folder containing the json that will then be sent back if it exists.

Route infos

Authorizations

This route is accessivle with no authorization at all.

Parameters

Mandatory

Parameter Data type Description Example
{categoryName} string The name of the category looked for. If it contains spaces, they should be replaced with underscores. Category_Name1

Optional

There are no optional parameters to give for this route.

Request body

As a GET request, the body should remain empty.

Response

When "successful", this route return a 200 or a 204 HTTP code. The 200 will be accompanied with a response body, containing the category as a json object ; while the 204 simply means the category file wasn't found on the server.
Here's what the response body will look like:

{
    "links": "",
    "pages": []
}