Queries for a list of filters using a list of parameters. The size of the result set can be retrieved by using the Get Filter Count method.

Method

GET /filter

Parameters

Query Parameters

Name Description
filterId Filter by the id of the filter.
resourceType Filter by the resource type of the filter, e.g., Task.
name Filter by the name of the filter.
nameLike Filter by the name that the parameter is a substring of.
owner Filter by the user id of the owner of the filter.
itemCount If set to true, each filter result will contain an itemCount property with the number of items matched by the filter itself.
sortBy Sort the results lexicographically by a given criterion. Valid values are filterId, firstName, lastName and email. Must be used in conjunction with the sortOrder parameter.
sortOrder Sort the results in a given order. Values may be asc for ascending order or desc for descending order. Must be used in conjunction with the sortBy parameter.
firstResult Pagination of results. Specifies the index of the first result to return.
maxResults Pagination of results. Specifies the maximum number of results to return. Will return less results if there are no more results left.

Result

A JSON array of filter objects. Each filter object has the following properties:

Name Value Description
id String The id of the filter.
resourceType String The resource type of the filter.
name String The name of the filter.
owner String The user id of the owner of the filter.
query Object The query of the filter as a JSON object.
properties Object The properties of a filter as a JSON object.
itemCount Long The number of items matched by the filter itself. Note: Only exists if the query parameter itemCount was set to true

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json Returned if some of the query parameters are invalid, for example if a sortOrder parameter is supplied, but no sortBy is specified. See the Introduction for the error response format.

Example

Request

GET /filter?resourceType=Task

Response

Status 200.

[
  {
    "id": "aFilter",
    "resourceType": "Task",
    "name": "My Filter",
    "owner": "jonny1",
    "query": {
      "assignee": "jonny1"
    },
    "properties": {
      "color": "#58FA58",
      "description": "Filters assigned to me"
    }
  },
  {
    "id": "anotherFilter",
    "resourceType": "Task",
    "name": "Accountants Filter",
    "owner": "demo",
    "query": {
      "candidateGroup": "accountant"
    },
    "properties": {
      "description": "Filters assigned to me",
      "priority": 10
    }
  }
]

Request with ItemCount Enabled

GET /filter?resourceType=Task&itemCount=true

Response with ItemCount

Status 200.

[
  {
    "id": "aFilter",
    "resourceType": "Task",
    "name": "My Filter",
    "owner": "jonny1",
    "query": {
      "assignee": "jonny1"
    },
    "properties": {
      "color": "#58FA58",
      "description": "Filters assigned to me"
    },
    "itemCount": 13
  },
  {
    "id": "anotherFilter",
    "resourceType": "Task",
    "name": "Accountants Filter",
    "owner": "demo",
    "query": {
      "candidateGroup": "accountant"
    },
    "properties": {
      "description": "Filters assigned to me",
      "priority": 10
    },
    "itemCount": 42
  }
]

目录: