Overview
TagType API is an API for managing the tags of users in Fess, the per-user tags that logged-in users put on documents (see Tag). It manages the tags of every user, whether user.tag.enabled is true or not.
For common specifications regarding authentication, responses (status codes, version field, error format, HTTP status codes, etc.), refer to Admin API Overview. To access this API, you must provide an access token with admin API permission (admin-api) in the Authorization: Bearer <access_token> header.
The JSON field names of this API are snake_case (sort_order, virtual_host, seq_no, primary_term, …).
Base URL
Endpoint List
| Method | Path | Description |
|---|---|---|
| gET | /settings | List tags |
| gET | /setting/{id} | get a tag |
| POST | /setting | Create a tag |
| PUT | /setting | Update a tag |
| DELETE | /setting/{id} | Delete a tag |
get a Tag
Request
Response
seq_no and primary_term identify the version of the tag that was read. paths and permissions hold one entry per line.
Create a Tag
Request
Request Body
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Tag name. It is NFKC-normalized, runs of whitespace are collapsed and the ends are trimmed; the result must be 1 to |
owner | String | Yes | Login user ID of the user who owns the tag (max 1000 characters). |
paths | String | No | URLs of the documents to put the tag on, separated by a newline ( |
permissions | String | No | Users/groups/roles that can see the tag (e.g. |
virtual_host | String | No | Virtual host (max 1000 characters). |
sort_order | Integer | No | Display order (non-negative integer). Defaults to 0 if not specified. |
The ID of a tag is the SHA-256 of its value, which is made from the name and the owner, so it is decided by the server. The owner and the name together identify a tag: creating a tag whose owner already has a tag of the name fails with a validation error (status: 1, “A tag with the same name and owner already exists.”).
Response
On successful creation, created is true.
Update a Tag
Request
Request Body
The body has all the fields used at creation time, and the following fields in addition. The tag is replaced as a whole, so send the paths you want to keep as well.
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The ID of the tag to update. |
seq_no | Integer | Yes | The seq_no of the tag returned by gET /setting/{id}. |
primary_term | Integer | Yes | The primary_term of the tag returned by gET /setting/{id}. |
When the tag was changed after it was read, that is,
seq_noandprimary_termno longer match, the update fails with a validation error (status: 1, “The tag was changed by someone else. Reload it and try again.”). get the tag again and retry.Changing
nameorownergives the tag a new ID; the responseidis the new one. When the owner already has a tag of the new name, the update fails with “A tag with the same name and owner already exists.”.When the owner changes, the user permission of the old owner in
permissionsis replaced with that of the new owner.
Response
On update, created is false.
Delete a Tag
Request
Response
When the tag is changed while it is being deleted, the deletion fails with “The tag was changed by someone else. Reload it and try again.”.
How Changes Reach Documents
Creating, updating and deleting a tag through this API is saved to the tags at once. While user.tag.enabled is true, the change is queued for the documents (the added and removed paths, a rename or a deletion) and applied by the per-minute “Log Aggregator” job (log_aggregator). While it is false, nothing is queued; run the “Tag Updater” job (tag_updater) after enabling tags. See Tag.
Usage Examples
See Also
Admin API Overview - Admin API Overview
Tags API - Tags API
Tag - Tag Management guide