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

REST user import paging

flegare
Regular Contributor III
Regular Contributor III

Hi folks,

We are trying to import users from another subsidiary's Saviynt instance (tenant2) into the main company's Saviynt (tenant1).

The first page comes in without any issues but paging won't kick in as expected.

Various paging methods have been attempted:

 

 

    "pagination": {
        "offset": {
            "offsetParam": "offset",
            "batchParam": "max",
            "batchSize": 50,
            "totalCountPath": "9999999"
        }
    }

 

 

This one reads one page and quits successfully.

 

 

"pagination": {
        "nextUrl": {
            "nextUrlPath": "${response?.completeResponseMap?.count<50?null:'https://tenant2.saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[some filter]&fields=[list of fields]&max=50&offset='+Math.addExact(parseInt(response.completeResponseMap.offset),response.completeResponseMap.count)}"
        }
    }

 

 

This one reads one page and aborts with message: "[error:Error Illegal character in path at index 1:" as it was not able to compute nextUrlPath.

I also tried "Math.addExact(response.completeResponseMap.offset,response.completeResponseMap.count)" and got the same error.  I figured since offset is a string in the response map, this could be the issue but apparently not...

Sample response payload:

 

 

{
    "msg": "Successful",
    "offset": "0",
    "count": 50,
    "errorCode": "0",
    "sort": "userkey",
    "results": [
        {
            [users 1...50]
        }
}

 

 

Any help would be greatly appreciated!

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count < 50 ? null : 'https://tenant2.saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[some filter]&fields=[list of fields]&max=50&offset=' + (parseInt(response.completeResponseMap.offset) + response.completeResponseMap.count)}"
}
}


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

flegare
Regular Contributor III
Regular Contributor III

Same error again... I have no idea where I am messing this up...

"2024-08-08T02:14:22.337+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-10-dcnbg","DEBUG","Got Webservice API Response: [error:Error Illegal character in path at index 1: ${response?.completeResponseMap?.count < 50 ? null : 'https://[tenant].saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[query]:IC&fields=[fields]=******&max=50&offset=' + (parseInt(response.completeResponseMap.offset),response.completeResponseMap.count)}]"

flegare
Regular Contributor III
Regular Contributor III

Solution found. parseInt was not enough, it needed the Integer prefix


"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)}"
}
}