Error using offset

I’m trying to create a service to get the list and datas from access-profiles.

When I send offset 0 and after offset 1, both request return always the same content.

For example…

{{baseUrl}}/beta/access-profiles?offset=1&sorters=name&count=true
{{baseUrl}}/beta/access-profiles?offset=2&sorters=name&count=true

Tkz

The offset parameter is usually set along with the limit parameter to paginate results. The default value for the limit parameter should be 50. So, if I’m understanding correctly, you seem to be asking for the first 50 access profiles with your first request and access profiles 51 - 100 with your second request. If you have less than 50 access profiles in your tenant, I would expect that IdentityNow will return the last “page” of results under your request parameters. That is, I’d expect that the results for the first request would match the results of the second request.

Try explicitly setting the limit parameter to something small (maybe even 1) and sending both requests again. You should see different results.

hello bbullock,

I have more than 300 AccessProfiles, if I send twice using limit 10 and offset 1 and 2. Some AccessProfiles come with repeats. That’s my problem.

For example the same AccessProfile ID: 2c91808674bc12010174c5b14b351b12 returned in the 2 rest requests (with offset=1 and with offset=2)

Sorry for the delay on this, I must have missed the notification of your response…

What you’re describing is exactly what I’d expect to see. If you want to paginate, set your offset to the same value as your limit. So, the first request (to get the first page of results) would have limit=SOME_VALUE and offset=0. The second request (to get the second page of results) would have the same limit=SOME_VALUE and offset=SOME_VALUE. The third request (to get the third page of results) would have the same limit=SOME_VALUE and offset=2*SOME_VALUE. Etcetera for each page of results.

The key is that the offset value is not a page offset, but a record offset.