I have made a REST connector for a REST endpoint. It has pagination with following response -
This is the first page response by just hitting the API url without passing page and page size . In other words, below JSON works (ignoring pagination)-
{
"connection": "acctAuth",
"successResponses": {
"statusCode": [
200
]
},
"url": "https://<removed>/api/workerdata?workerData=fullData&workerType=workerdetails",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept":"application/json",
"client_id":"<removed>",
"client_secret":"<removed>",
"x-correlation-id":"${java.util.UUID.randomUUID().toString()}"
},
"httpParams": "{}",
"httpContentType":"application/json",
"userResponsePath": "data",
"colsToPropsMap": {
"customproperty2": "personId~#~char",
"SITEID": "workerDetails.position.orgPath~#~char"
}}
Now after considering Pagination, i have come up with following JSON -
{
"connection": "acctAuth",
"successResponses": {
"statusCode": [
200
]
},
"url": "https://<removed>/api/workerdata?workerData=fullData&workerType=workerdetails&asOf=<removed>",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept":"application/json",
"client_id":"<removed>",
"client_secret":"<removed>",
"x-correlation-id":"${java.util.UUID.randomUUID().toString()}"
},
"httpParams": "{}",
"httpContentType":"application/json",
"userResponsePath": "data",
"colsToPropsMap": {
"customproperty2": "personId~#~char",
"SITEID": "workerDetails.position.orgPath~#~char"
},
"pagination": {
"page": {
"pageSizeParam": "pageSize",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.records",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.totalRecords",
"firstPageNumber": 1
}
}
}
On executing the above JSON - it iterates again through the first page but for next page i get an error as found in Saviynt logs and job log page-
Failed url-https://<removed>/api/workerdata?workerData=fullData&asOf=-<removed>&workerType=workerdetails&pageSize=100&page=2 with Error Message-{ "code": 500, "errorType": "MULE:ANY", "message": "You cannot use an existing correlation id", "correlationId": "<removed>", "timestamp": "2024-07-18T07:48:22.57Z", "detail": "You cannot use an existing correlation id", "instance": "<removed>xml:127 (You cannot use an existing correlation id)" }
Meaning of above is basically the httpheader passed "x-correlation-id":"${java.util.UUID.randomUUID().toString()}" is the same one sent in for PAGE=1 i.e. its not getting computed after pagination logic executes.
{NOTE-MY API REQUIRES A RANDOM GUID TO BE SENT IN EVERY REQUEST MADE MANDATORILY}
Is this a Saviynt issue? Any help here would be much appreciated.