Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/28/2024 06:46 AM - edited 08/28/2024 06:52 AM
Hi everyone,
I’m facing an issue with the Saviynt connector related to pagination when importing users via the REST API. Here’s the situation:
I can successfully test the connection when I specify a single user, make a change, and run the update job. like the following:
"url": "https://XXXXXX.saviyntcloud.com/ECM/api/v5/user?q=username:AT0345678&fields=username,email,displayname",
However, when I try to include all users using the following configuration, it only updates 50 users, even though I have set the batch size and the total count path correctly.
Here’s the JSON configuration I used:
{
"url": "https://XXXXXX.saviyntcloud.com/ECM/api/v5/user?q=username:AT0345678&fields=username,email,displayname&order=desc&max=10000",
and
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 50,
"totalCountPath": "completeResponseMap.total"
}
}
}
However, this only processes 50 users.
I tried several methods, including the examples from the Saviynt documentation:
Saviynt Developers Handbook
Postman Documentation
Most recently, I tried this configuration:
{
"url": "https://XXX.saviyntcloud.com/ECM/api/v5/user?q=accountExpired:0&fields=username,email,displayname&order=desc&max=10000",
and
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 500,
"totalCountPath": "1500",
"paramPosition": "url,httpHeaders,httpParams"
}
}
}
This time, it gave me 500 users but did not continue to fetch the next batch of 500, regardless of how I adjusted the offset or max parameters. Sometimes, it only returns 50 users.
Has anyone encountered a similar issue? Any suggestions on how to fix this or make the pagination work as expected? an use case that is working regarding this ?
i attached the logs file
Thanks in advance for your help!
Solved! Go to Solution.
08/28/2024 06:55 AM - edited 08/28/2024 08:11 PM
Refer https://forums.saviynt.com/t5/identity-governance/rest-user-import-paging/m-p/109927#M73165
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count<50?null:'https://[tenant].saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[query]&fields=[list of fields]&max=50&offset='+Math.addExact(Integer.parseInt(response.completeResponseMap.offset),50)}"
}
}
08/28/2024 07:05 AM
Hi @Roua Can you please try this ?
"offset": {
"offsetParam": "offset",
"startOffsetIndex": 0,
"batchParam": "limit",
"batchSize": 500,
"paramOrder": "offsetParam,batchParam",
"paramPosition": "url",
"totalCountPath": 1500
}
Regards,
Indra
08/28/2024 08:02 PM
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count<50?null:'https://XXXXXXX.saviyntcloud.com/ECM/api/v5/user?sort=userkey&fields=username,email,displayname&max=50&offset='+Math.addExact(Integer.parseInt(response.completeResponseMap.offset),50)}"
}
}
08/29/2024 11:57 PM
Thank you all!
it worked with the provided solution thank you:
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count < 50 ? null : 'https://xxxxxx.saviyntcloud.com/ECM/api/v5/user?q=accountExpired:0&fields=username,email,displayname&max=50&offset=' + Math.addExact(Integer.parseInt(response.completeResponseMap.offset), 50)}"