Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/queries/create

Requires JWT

Create a new query.

Request

POST /api/p/<project gid>/queries/create
Authorization: Bearer <JWT>

{
    "type": "record",
    "name": "Missing record translations",
    "q": "",
    "filter": ["or", "",
                  [
                      ["validation", "not_translated", "name"],
                      ["validation", "not_translated", "description"],
                  ],
              ]
}

type 'asset', 'record', or 'schema'
name a user-defined name for the query

Note: if the name exists within a type, a serial number is appended to make it unique.

optional

q search terms, like '+cms 225'
filter json with nested filter specification (see the basic workings of a filter)

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "query": "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74"
    },
    "data": {
        "queries": {
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74": {
                
            }
        }
    }
}

result

query the newly created query.

data

queries Query info with type, name, q, and filter.

Error responses

400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - create failed