Up - API Reference - Home
Requires JWT.
Autocompletion helper for search for assets.
This is meant to autocomplete values for the filters, specifically name, ext, path, and metadata.
POST /api/p/<project gid>/assets/search/autocomplete
Authorization: Bearer <JWT>
{
"field": "path",
"fieldq": "/pro",
"language": "nl"
}
field is the field we're looking to complete ("name", "ext", "path", or "metadata")
fieldq is the start of the value
language is the language to search in
completions.size only return this many completions (default 10, min 1, max 50).
For the "metadata" field, the fieldq can be any part of the group name or the full group name followed by a dot for the fields in that group. Values after the dot will further narrow the results.
For instance, we have two metadata groups with the following fields:
group_1.field_A
group_1.field_B
group_2.field_A
Then:
fieldq = "" -> returns "group_1", "group_2"
fieldq = "gro" -> returns "group_1", "group_2"
fieldq = "oup" -> returns "group_1", "group_2" (any part of group is ok)
fieldq = "group_1" -> returns "group_1"
fieldq = "group_1." -> returns "group_1.field_A", "group_1.field_B"
fieldq = "group_1.fie" -> returns "group_1.field_A", "group_1.field_B"
fieldq = "group_1.eld" -> returns no results (fields must match from the start)
Note: for metadata, when the full group name and dot are given, the
completions.sizeis ignored, and all matching fields are returned.
Authorization: <JWT>
{
"success": true,
"result": {
"completions": [
"/products",
"/promo"
]
},
"data": {}
}
completions completions for the field
No data.
400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
1002 Search error - internal search engine error