PARTNERS - Please join us for our upcoming webinar:
Leveraging Intelligent Recommendations for Operational Transformation.
AMS Partners click HERE | EMEA/APJ Partners click HERE

REST API - USER IMPORT - httpParams from response

ag420
New Contributor III
New Contributor III

Hello Experts 🙂

I have made a REST connector for a REST endpoint. It has pagination with following response -

 

ag420_1-1721332117648.png

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.
3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Concate with system datetime


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

NM
Honored Contributor
Honored Contributor

@ag420 You can use time in millisecond

ag420
New Contributor III
New Contributor III

For some reason, the value is getting calculated only once and then being passed on in the next call as well. i am closing this thread. Continued at Dynamic httpParams -REST - Saviynt Forums - 105769