API Issue after upgrade: Browse method of Nodes API always returns 100 items

Options

We upgraded OTCS from 16.x to 21.3. Since then, the browse method of nodes API started returning 100 items only no matter what item type or limit is. Here is how our calls are structured and what the description of this method is in API documentation. Any suggestions or insights please?

2 samples of our calls:

v2/nodes/{folderId}/nodes?where_type=0&page=1&limit=1000&fields=properties{id,type,type_name,name,create_date}

v2/nodes/{FolderId}/nodes?where_type=0&fields=properties{id,type,type_name,name,create_date}

Description of this method (reference):

Browse

This call will return information about the children for the specified node ID. This can be called without parameters, defaulting to page 1, limit 25 and sort asc_name.

Method: GET
URL: api/v1/nodes/<id>/nodes

The return values may include:

  • data: property values for each child
  • definitions: definitions for each property value
  • limit: maximum number of items to return [Integer]
  • page: current page number [Integer]
  • page_total: total number of pages
  • total_count: total number of items
  • range_min: offset (min)
  • range_max: offset (max)
  • sort: column name used in sort [String], in the format [asc][desc]_{column name}
  • where_name: name filter [String]
  • where_type: subtype filter [Integer]
  • where_facet: facet filter [String], in the format {facet id}:{facet value}


Tagged:

Comments

  • Thanks for the reply. After I submitted this question, I decided to use pagination which resolved the issue.

  • Yalin Meric
    edited April 26, 2022 #4
    Options

    Update! My initial pagination logic got stuck for folders that had multiples of 100 of documents (100, 200, 300, etc.) because the API does not throw an error even if you provide a page number that should/does not exist. For example if there are 200 documents in a folder and my code requested page 3, the API returned page 2 instead of throwing an error causing an infinite loop. I had to improve the logic to keep track of the last item in the list so that when the API returns an item again the logic broke out of the loop.

  • @Yalin Meric it wont throw an error as that page may not exist for the user you are logged in with, but may do for another user due to permissions on content.