Integrate

Search and paging

List and search tasks and items with pages, free text, filters and sort.

List with pages

The list routes return one page of results. Page numbers start at 1.

Query parameterDefaultMeaning
number1Page number.
size50Number of items per page. The maximum is 1000.
GET https://rologi-flow.example.com/api/pick-tasks?number=1&size=50
Authorization: Bearer <token>

The answer has two parts:

  • content: the items of this page.
  • page: the paging data: number, size, totalElements and totalPages.

A search route takes a JSON body with three optional parts.

FieldMeaning
searchFree text. A resource matches when one of its searchable fields contains the text. Case is ignored. The text is used as a whole, without wildcards.
filterA list of conditions. A resource must match all conditions, and the search text if you send one.
pagenumber, size and sort. The default is page 1, size 50 and no sort.
POST https://rologi-flow.example.com/api/pick-tasks
Authorization: Bearer <token>
Content-Type: application/json

{
  "search": "John",
  "filter": {
    "type": "QUERY",
    "query": [
      {
        "field": "state",
        "operator": "in",
        "value": ["COMPLETED", "CANCELED", "FAILED"]
      }
    ]
  },
  "page": {
    "number": 1,
    "size": 50,
    "sort": "state desc, name"
  }
}

Rules that apply to each search route:

  • Search, filter and sort apply to all resources before Rologi Flow cuts the page.
  • A field of a nested list matches when one element or more matches.
  • An unknown or unsupported field gives 400.
  • Results are always ordered by id last, so paging is stable.

Filter conditions

A condition has a field, an operator and a value.

  • Operators: is, eq, ne, co, sw, ew, gt, gte, lt, lte, in.
  • The type of value depends on the field and the operator. Use a list with in.
  • Use true or false with the operator is for null checks.

Each resource has its own lists of fields for search, filter and page.sort. The search request object gives them.