LianaCMS REST API

Categories

Serverhttps://example.lianacms.com/api/v3

The category tree that news, events and products are filed under.


List categories

GET
https://example.lianacms.com/api/v3
/categories

Returns the categories of all modules (news, events, products, contacts and others) that the user can see. The user must have the categories permission, the view right to the category and the admin right to the category and each of its ancestors below the module's root category. The root categories themselves are never returned. Items are ordered by id, highest first, and have no href.

The module is not checked: any authenticated user gets the categories their rights allow, or an empty list.

List categories › query Parameters

limit
​integer · min: 0 · max: 200

The number of items to return, 0 to 200. A value outside that range returns 400.

Default: 20
offset
​integer · min: 0

The number of items to skip. A negative value is treated as 0. Use the next and prev links of the response to page through a list.

Default: 0
langcode[]
​string[] · style: form · explode: true

Return only categories that have a name in one of the given languages. The codes are matched exactly, so use upper case (FI, EN). The parameter must be sent as an array (langcode[]=FI&langcode[]=EN); a plain langcode=FI is refused with 400.

Example: ["FI","EN"]

List categories › Responses

OK

Links of a list response. There is no `last` link and no total count.
href
​string
​object

First page.

​object

Previous page; the offset stops at 0.

​object

Next page. On the last page the link wraps around to offset 0.

​Meta

Get a category

GET
https://example.lianacms.com/api/v3
/categories/{category-id}

Returns one category as the only element of items. The user must have the categories permission and the admin right to the category and each of its ancestors below the module's root category.

400 is returned when the id is not an integer. 404 is returned when the category does not exist, is a root category, or the user lacks the rights.

Get a category › path Parameters

category-id
​integer · required

Id of the category.

Get a category › Responses

OK

href
​string
​Meta