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

Multicall UserImportJson - 2 calls

VJR
New Contributor
New Contributor

We are integrating with Oracle HCM via Rest ConnectionType and trying to invoke 2 calls in the userImport to get user's additional details like Location.

We are able to make a successful call with hardcode values (LocationId and username) in the call2, but we are unable to fetch LocationId and PersonNumber based on the call1 response.

call1 url: https://<<url>>/hcmRestApi/resources/11.13.18.05/workers to get the user details. Based on the call1 response (customproperty45-LocationId, username-PersonNumber) we have to make another call to get the location details. 

 

Spoiler
UserImportJson:

{
"type": "multiCall",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://<<url>>/hcmRestApi/resources/latest/workers?q=PersonNumber=909090",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}"
},
"userResponsePath": "items",
"colsToPropsMap": {
"username": "PersonNumber~#~char",
"country": "addresses[0].Country~#~char",
"city": "addresses[0].TownOrCity~#~char",
"regioncode": "addresses[0].PostalCode~#~char",
"state": "addresses[0].Region2~#~char",
"street": "addresses[0].AddressLine1~#~char",
"phoneNumber": "phones[0].PhoneNumber~#~char",
"displayName": "DisplayName~#~char",
"termDate": "workRelationships[0].TerminationDate~#~char",
"startDate": "workRelationships[0].StartDate~#~char",
"title": "names[0].Title~#~char",
"firstname": "names[0].FirstName~#~char",
"lastname": "names[0].LastName~#~char",
"preferredfirstname": "names[0].KnownAs~#~char",
"middleName": "names[0].MiddleNames~#~char",
"employeeId": "PersonNumber~#~char",
"customproperty6": "emails[0].emailAddress~#~char",
"customproperty7": "names[0].LocalFullName~#~char",
"customproperty8": "phones[0].PhoneNumber~#~char",
"customproperty10": "workRelationships[0].RevokeUserAccess~#~char",
"customproperty11": "workRelationships[0].WorkerType~#~char",
"customproperty50": "workRelationships[0].CreationDate~#~char",
"customproperty45":"workRelationships[0].assignments[0].LocationId~#~char",
"job_function": "PositionNumber~#~char",
"employeeType": "SystemPersonType~#~char"
},
"listField": "items",
"keyField": "PersonNumber",
"colsToPropsMap": {
"customproperty45": "LocationId~#~char"}
},
{
"name": "call2",
"connection": "acctAuth",
"dependentCall": "true",
"url": "https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${LocationId}",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"userResponsePath": "items",
"colsToPropsMap": {
"username": "${userIdentifier}~#~char",
"customproperty46": "AddressLine1~#~char",
"customproperty47": "AddressLine2~#~char"
}
}
]
}

 

call2 url: https://<<url>>//hcmRestApi/resources/11.13.18.05/locations?q=LocationId=123456

We tried ${userIdentifier} and ${PersonNumber} in the call2 to get the username ex-> "username": "${userIdentifier}~#~char" and to get the LocationId we tried with ${LocationId}, ${customproperty45} but none worked.

Note: Call2 won't accept username in the url/payload and doesn't return username as a part of the response.

Spoiler
Error Log: Got Webservice API Response: [error:Error Illegal character in query at index 117: https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${LocationId}]
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-3-jmhtj-DEBUG-pullObjectsByRest - responseStatusCode ::null
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-3-jmhtj-DEBUG-Got showLogs = true
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-3-jmhtj-DEBUG-Got null response statusCode with erroMsg - [error:Error Illegal character in query at index 117: https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${LocationId}]
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-jmhtj-ERROR-Exception in getting response in pullObjectsByRest :
2024-08-20T15:58:03-04:00-ecm-worker--null-jmhtj--java.lang.Exception: NullResponseFromTarget at com.saviynt.provisoning.rest.RestUtilService.checkForErrorMsg(RestUtilService.groovy:1463) at com.saviynt.provisoning.rest.RestProvisioningService.pullObjectsByRest(RestProvisioningService.groovy:4551) at com.saviynt.provisoning.rest.RestProvisioningService.getUsersData(RestProvisioningService.groovy:11836) at com.saviynt.provisoning.rest.RestProvisioningService$_importUsers_closure19_closure101.doCall(RestProvisioningService.groovy:2953) at com.saviynt.provisoning.rest.RestProvisioningService$_importUsers_closure19.doCall(RestProvisioningService.groovy:2944) at com.saviynt.provisoning.rest.RestProvisioningService.importUsers(RestProvisioningService.groovy:2935) at com.saviynt.ecm.integration.ExternalConnectionCallService.importUserUsingExternalConnection(ExternalConnectionCallService.groovy:1251) at UserImportJob.execute(UserImportJob.groovy:108) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-3-jmhtj-DEBUG-Got showLogs = true
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-3-jmhtj-DEBUG-Got showLogs = true
2024-08-20T15:58:02-04:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-jmhtj-DEBUG-Error while getting User Import response for url- https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${LocationId} is: null

Any suggestions for resolving this issue would be appreciated!

 

Thanks,

VJ

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

${call1.response.workRelationships[0].assignments[0].LocationId}


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

Hi Rushikesh,

I tried as you suggested, and it didn't work!

Here is the log:

Got Webservice API Response: [error:Error Illegal character in query at index 117: https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${call1.response.workRelationships[0].assignments[0].LocationId}]
2024-08-20T21:51:00-04:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-12-jmhtj-DEBUG-Got null response statusCode with erroMsg - [error:Error Illegal character in query at index 117: https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${call1.response.workRelationships[0].assignments[0].LocationId}]
2024-08-20T21:51:00-04:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-12-jmhtj-DEBUG-Error while getting User Import response for url- https://<<url>>/hcmRestApi/resources/11.13.18.05/locations?q=LocationId=${call1.response.workRelationships[0].assignments[0].LocationId} is: null