Category API

Get all categories

GET http://lrr.tvc-16.science/api/categories

Get all the categories saved on the server.

[
  {
    "archives": [],
    "id": "SET_1589227137",
    "name": "doujinshi πŸ’¦πŸ’¦πŸ’¦",
    "pinned": "1",
    "search": "doujinshi"
  },
  {
    "archives": [],
    "id": "SET_1589291510",
    "name": "All archives by uo denim",
    "pinned": "0",
    "search": "artist:uo denim"
  },
  {
    "archives": [
      "b835f24b953c236b7bbb22414e4f2f1f4b51891a",
      "9ed04c35aa41be137e3e696d2001a2f6d9cbd38d",
      "8b0b6bb3d180eff607c941755695c317570d8449",
      "a5c0958ad25642e2204aff09f2cc8e70870bd81f",
      "32f0edeb5d5b3cf71a02b39279a69d0a903e4aed"
    ],
    "id": "SET_1589493021",
    "name": "The very best",
    "pinned": "0",
    "search": ""
  }
]

Get a single category

GET http://lrr.tvc-16.science/api/categories/:id

Get the details of the specified category ID.

Path Parameters

NameTypeDescription

id*

string

ID of the Category desired.

{
  "archives": [],
  "id": "SET_1613080290",
  "name": "My great category",
  "pinned": "0",
  "search": ""
}

πŸ”‘Create a Category

PUT http://lrr.tvc-16.science/api/categories

Create a new Category.

Query Parameters

NameTypeDescription

pinned

boolean

Add this parameter if you want the created category to be pinned.

search

string

Matching predicate, if creating a Dynamic Category.

name*

string

Name of the Category.

{
  "category_id": "SET_1589383525",
  "operation": "create_category",
  "success": 1
}

πŸ”‘Update a Category

PUT http://lrr.tvc-16.science/api/categories/:id

Modify a Category.

Path Parameters

NameTypeDescription

id*

string

ID of the Category to update.

Query Parameters

NameTypeDescription

name

string

New name of the Category

search

string

Predicate. Trying to add a predicate to a category that already contains Archives will give you an error.

pinned

boolean

Add this argument to pin the Category.

\

If you don't, the category will be unpinned on update.

{
  "category_id": "SET_1589573608",
  "operation": "update_category",
  "success": 1
}

πŸ”‘Delete a Category

DELETE http://lrr.tvc-16.science/api/categories/:id

Remove a Category.

Path Parameters

NameTypeDescription

id*

string

ID of the Category to delete.

{
  "operation": "delete_category",
  "success": 1
}

πŸ”‘Add an Archive to a Category

PUT http://lrr.tvc-16.science/api/categories/:id/:archive

Adds the specified Archive ID (see Archive API) to the given Category.

Path Parameters

NameTypeDescription

id*

string

Category ID to add the Archive to.

archive*

string

Archive ID to add.

{
  "operation": "add_to_category",
  "success": 1,
  "successMessage": "Added \"Name of archive\" to category \"Name of category\""
}

πŸ”‘Remove an Archive from a Category

DELETE http://lrr.tvc-16.science/api/categories/:id/:archive

Remove an Archive ID from a Category.

Path Parameters

NameTypeDescription

id*

string

Category ID

archive*

string

Archive ID

{
  "operation": "remove_from_category",
  "success": 1
}

Last updated