Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/13/2024 03:00 AM
@ShubhamBabbar
I see a post from you that, you were able to resolve the pagination issue. Could you please share the full link as it was broken.
https://forums.saviynt.com/t5/identity-governance/rest-connector-offset-pagination/m-p/43765/thread-...
I am trying to resolve the pagination, but it is failing with errors.
This is my acctEntParams JSON
"acctEntParams": {
"connection": "userAuth",
"entTypes": {
"Teams": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "httpAcctToEnt",
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://SBUS.api.blackline.com/v1/users/${id}/teams",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "items",
"entKeyField": "entitlementID",
"entIdPath": "id",
"acctKeyField": "accountID"
}
}
},
"Entities": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "httpAcctToEnt",
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://abc.com/v1/users/${id}/entities?pageStartIndex=0&count=25",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "items",
"entKeyField": "entitlement_value",
"entIdPath": "name",
"acctKeyField": "accountID",
"pagination": {
"totalCountPath": "1000",
"nextUrl": {
"nextUrlPath": "${response.completeResponseMap.itemsPerPage<25?null:'http://abc.api.blackline.com/v1/users/${id}/entities?pageStartIndex='+Math.addExact(response.complet...}"
}
}
}
}
}
}
}
This is the pagination which i have added.
"pagination": {
"totalCountPath": "1000",
"nextUrl": {
"nextUrlPath": "${response.completeResponseMap.itemsPerPage<25?null:'http://abc.api.blackline.com/v1/users/${id}/entities?pageStartIndex='+Math.addExact(response.complet...}"
}
}
Response in Saviynt logs
responseText:{"itemsPerPage":2,"pageStartIndex":0,"items":[{"id":34567,"level":5,"name":"ICH and BACH","parentId":12345,"uniqueCode":"ICH"},{"id":32456,"level":8,"name":"DIVISION","parentId":null,"uniqueCode":"DIV"}],"totalItems":2}, cookies:[], statusCode:200]"
Job Failure Message
Error while getting entMappingParams Response WebService call failed with responseStatusCode null | Failed url-http://abc.com/v1/users/${id}/entities?pageStartIndex=25&count=25 for entType-Entities with Error Message-null |
If possible, can you share the full nexturl. I tried with this also but it didn't worked.
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.itemsPerPage<25?null:'http://SBUS.api.blackline.com/v1/users/${id}/entities?count=25&pageStartIndex=%27+Math.addExact(resp...)}"
}
}
Solved! Go to Solution.
09/13/2024 03:17 AM
Hi @SJ_544 ,
The problem I had with pagination was that my API did not support StartIndex = 0 but started with StartIndex = 1, which is different from your use case.
You can use the following pagination with offset
"pagination": {
"offset": {
"offsetParam": "pageStartIndex",
"batchParam": "count",
"batchSize": 1000,
"totalCountPath": "completeResponseMap.totalItems"
}
},
09/13/2024 03:21 AM
Hi @ShubhamBabbar - Tried this but it didn't worked.
09/13/2024 03:48 AM
09/13/2024 03:48 AM
09/13/2024 04:10 AM
Tried already, but no luck.
09/13/2024 04:22 AM
Can you paste the entire json and what error are you seeing in logs?
09/13/2024 04:49 AM
@ShubhamBabbar - I was able to resolve the issue. Application API is not giving the valid response. I have verified in the Response header (Link) there i found the batchParam name as different than the response value. This is the correct Param "pageSize".
Correct Pagniation Value for future reference
"pagination": {
"offset": {
"offsetParam": "pageStartIndex",
"batchParam": "pageSize",
"batchSize": 1000,
"totalCountPath": "completeResponseMap.totalItems"
}
}