Named Queries
Named Queries
It's possible to create named queries. These are stored queries that may be reused simply by referring to it by name. Named queries are specific to a user.
By sending a POST to the endpoint /api/xml/query/named/{queryType} you can create a named query which may be recalled using the /api/xml/query/named endpoint.
Three queryTypes are currently supported.
In addition to the queryName parameter, all parameters from the query of the selected type is allowed. To recall a query use the /api/xml/query/named endpoint using the queryName parameter. If no queryName parameter is give, the result will be a list of existing named queries for the current user.
There is a cache for the results of SimpleEventQuery and ExtendedEventQuery, which is cleared 5 minutes after the last update. Therefore result of named query doesn't need to be up-to-date. If you need to bypass cache, use parameter invalidateCache=true. There is no such cache for object named queries so far.
By specifying the parameter "refreshInterval" when creating a named query, you are able to state the time in seconds after which the cached results of the named query should be updated.
To delete a query, send a DELETE request to the same endpoint.