Labs64 / NetLicensing-Community

NetLicensing Community Support
https://netlicensing.io
MIT License
5 stars 1 forks source link

How do I list all pages of licensees using the RESTful API? #43

Closed kevinhiltb9 closed 2 years ago

kevinhiltb9 commented 2 years ago

Question Using the RESTful API to list licensees, how do I get all entries? I can only get the first page, and there are four total pages.

Request URL https://go.netlicensing.io/core/v2/rest/licensee

Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:netlicensing xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:ns2="http://netlicensing.labs64.com/schema/context">
    <ns2:infos/>
    <ns2:items pagenumber="0" itemsnumber="100" totalpages="4" totalitems="398" hasnext="true">
. . .
r-brown commented 2 years ago

Hello @kevinhiltb9 You can retrieve the next available pages by adding a filter ?filter=page=N;items=100 to the Licensee.list() method

GET https://go.netlicensing.io/core/v2/rest/licensee?filter=page=1;items=100

related issue: https://github.com/Labs64/NetLicensing-Community/issues/27#issuecomment-773934112

kevinhiltb9 commented 2 years ago

Thank you, I'll give it a shot.

Out of curiosity, is this mentioned anywhere in the documentation? I looked before opening an issue here and didn't see anything in the wiki article. I did see the filter option in the JavaDoc for the list function, but it says "filter - reserved for the future use, must be omitted / set to NULL".

r-brown commented 2 years ago

Indeed, this is not-documented feature, as we plan to introduce mid-term a new planned feature: NLQL - NetLicensing Query Language This new feature will deprecate existing filter options.