Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

getUser API returning only 500 users

sandeepverma
Regular Contributor
Regular Contributor

Hi Team,

Using "url": "https://******/ECM/api/v5/getUser" we can get max 500 users in Postman so I understand to increase the displayed number we have to use user pagination but where do we have to use this pagination in Postman.

could you please provide some samples and guidance on same?

Thank you,

Sandeep 

5 REPLIES 5

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @sandeepverma,

To retrieve records with pagination, you currently need to manually set the "Offset" and "Max" values in the URL, as demonstrated below:

URL: https://xxxx.saviyntxxx.com/ECM/api/v5/user?q=accountExpired:0&fields=firstname,lastname,username&so... 

Please note that the default setting for "Max" is 500, and you'll need to adjust the "Offset" and "Max" values as needed to fetch the desired records. If you wish to retrieve a greater number of records, this will require changes at the database level,

If you require assistance with fetching a larger set of records, please consider raising a support ticket for further guidance.

Thanks.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Volker
New Contributor III
New Contributor III

Hi @sandeepverma ,

whats about that approach:

  • Put these 2 variables into your collection: "offset" and "max"

Volker_0-1701415130874.png

  • use that request URL
{{SSM_url}}/ECM/{{SSM_path}}/user?q=accountExpired:0&fields=firstname,lastname,username&sort=username&order=desc&offset={{offset}}&max={{max}}
  • put this script into your test section of the request

Volker_1-1701415236511.png

var jsonData = JSON.parse(responseBody);
if (jsonData.count==0) {
    pm.collectionVariables.set("offset",0)
else {
    pm.collectionVariables.set("offset",parseInt(pm.collectionVariables.get("offset")) + parseInt(pm.collectionVariables.get("max")))
}

In my environment it paginates correct and I get all users in the subsequent results. 

good luck 🙂

Regards

Volker
New Contributor III
New Contributor III

@sandeepverma 
small addition to my former post.

To reflect your concrete URL in question, the provided information should be working with small corrections and of course that code is just a proof which needs for sure a rework to get production ready 🙂

  • URL
{{SSM_url}}/ECM/{{SSM_path}}/getUser?offset={{offset}}&max={{max}}
  • and the following script
var jsonData = JSON.parse(responseBody);
if (jsonData.displaycount==0) {
    pm.collectionVariables.set("offset",0)
else {
    pm.collectionVariables.set("offset",parseInt(pm.collectionVariables.get("offset")) + parseInt(pm.collectionVariables.get("max")))
}

Volker_2-1701415994823.png

 

 

sandeepverma
Regular Contributor
Regular Contributor

Hi @sudeshjaiswal,

Currently, I have one query here suppose I have 2500 users in Saviynt, can we achieve using max and offset in URL or do we have to reach out and raise a support ticket with Saviynt?

Thank you,

Sandeep   

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @sandeepverma,

I would suggest to reach out to support team as it required DB level changes and ask them to increase the size from 500 to 2500 in the table.

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".