Category API

get
Get all categories

http://lrr.tvc-16.science/api/categories
Get all the categories saved on the server.
Request
Response
Request
Response
200: OK
You get the categories. The "id" parameter is to be used in the next endpoints.
[
{
"archives": [],
"id": "SET_1589227137",
"last_used": "1589487499",
"name": "doujinshi 💦💦💦",
"pinned": "1",
"search": "doujinshi"
},
{
"archives": [],
"id": "SET_1589291510",
"last_used": "1589487501",
"name": "All archives by uo denim",
"pinned": "0",
"search": "artist:uo denim"
},
{
"archives": [
"b835f24b953c236b7bbb22414e4f2f1f4b51891a",
"9ed04c35aa41be137e3e696d2001a2f6d9cbd38d",
"8b0b6bb3d180eff607c941755695c317570d8449",
"a5c0958ad25642e2204aff09f2cc8e70870bd81f",
"32f0edeb5d5b3cf71a02b39279a69d0a903e4aed"
],
"id": "SET_1589493021",
"last_used": "1589493776",
"name": "The very best",
"pinned": "0",
"search": ""
}
]

put
🔑Create a Category

http://lrr.tvc-16.science/api/categories
Create a new Category.
Request
Response
Request
Query Parameters
pinned
optional
boolean
Add this parameter if you want the created category to be pinned.
search
optional
string
Matching predicate, if creating a Dynamic Category.
name
required
string
Name of the Category.
Response
200: OK
The category is successfully created.
{
"category_id": "SET_1589383525",
"operation": "create_category",
"success": 1
}
400: Bad Request
You did not specify a category name.
{
"error": "Category name not specified.",
"operation": "create_category",
"success": 0
}

put
🔑Update a Category

http://lrr.tvc-16.science/api/categories/:id
Modify a Category.
Request
Response
Request
Path Parameters
id
required
string
ID of the Category to update.
Query Parameters
name
optional
string
New name of the Category
search
optional
string
Predicate. Trying to add a predicate to a category that already contains Archives will give you an error.
pinned
optional
boolean
Add this argument to pin the Category. If you don't, the category will be unpinned on update.
Response
200: OK
The category is updated with the specified info.
{
"category_id": "SET_1589573608",
"operation": "update_category",
"success": 1
}
400: Bad Request
The ID you've specified doesn't exist.
{
"error": "The given category does not exist.",
"operation": "update_category",
"success": 0
}

delete
🔑Delete a Category

http://lrr.tvc-16.science/api/categories/:id
Remove a Category.
Request
Response
Request
Path Parameters
id
required
string
ID of the Category to delete.
Response
200: OK
The Category is deleted. This endpoint doesn't return error codes for the time being.
{
"operation": "delete_category",
"success": 1
}

put
🔑Add an Archive to a Category

http://lrr.tvc-16.science/api/categories/:id/:archive
Adds the specified Archive ID (see Archive API) to the given Category.
Request
Response
Request
Path Parameters
id
required
string
Category ID to add the Archive to.
archive
required
string
Archive ID to add.
Response
200: OK
Archive is added. This endpoint doesn't return error codes for the time being.
{
"operation": "add_to_category",
"success": 1
}

delete
🔑Remove an Archive from a Category

http://lrr.tvc-16.science/api/categories/:id/:archive
Remove an Archive ID from a Category.
Request
Response
Request
Path Parameters
id
required
string
Category ID
archive
required
string
Archive ID
Response
200: OK
The archive is removed from the category. This endpoint doesn't return error codes for the time being.
{
"operation": "remove_from_category",
"success": 1
}