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

Multiple Calls - Illegal character, when using response in URL

Murmur
Regular Contributor III
Regular Contributor III

Hi everyone, 

I'm currently setting up a REST connector (Entra ID) to provision Users. The creation itself works fine. Unfortunately I hit a problem, when I try to set the manager of the respective account.

Issue

I need to know the users id (u-id) and the managers id (m-id). 
The u-id could be extracted from the response of call1.
The m-id could be extracted from the response of call2.

When I now initiate call3 with an url like https://......./${response.call1.message.id/..... I receive the following error message in the Logs: 

 
Thanks in advance for everyones help. Below you'll find some relevant infos.
 
Cheers 🙂
 

CreateUserJSON: 

{"accountIdPath":"call1.message.id",
"dateFormat":"yyyy-MM-dd'T'HH:mm:ssXXX",
"processingType": "SequentialAndIterative",
"responseColsToPropsMap":{"displayName":"call1.message.displayName~#~char",
"name":"call1.message.userPrincipalName~#~char"},
"call":[

{
"name":"call1",

"connection":"AzureADProvisioning",
"url":"https://graph.microsoft.com/v1.0/users",
"httpMethod":"POST",
"httpParams":"{\"accountEnabled\":false,\"displayName\":\"${user.displayname}\",\"companyName\":\"${user.companyname}\",\"givenname\":\"${user.firstname}\",\"surname\":\"${user.lastname}\",\"jobTitle\":\"${user.title}\",\"userPrincipalName\":\"${user.email}\",\"mailNickname\":\"${user.customproperty63}\",\"usageLocation\":\"${user.country}\",\"employeeId\":\"${user.employeeid}\",\"mail\":\"${user.email}\",\"passwordProfile\":{\"forceChangePasswordNextSignIn\":true,\"password\":\"${password}\"}}",
"httpHeaders":{"Authorization":"${access_token}"},
"httpContentType":"application/json",
"successResponses":{"statusCode":[200,201,204,205]}},

{
"name":"call2",

"connection":"AzureADProvisioning",
"url":"https://graph.microsoft.com/v1.0/users/${userManager.email}",
"httpMethod":"GET",
"httpParams":"",
"httpHeaders":{"Authorization":"${access_token}"},
"httpContentType":"application/json",
"successResponses":{"statusCode":[200,201,204,205]},
"inputParams": {"dependentCall": true}},

{
"name":"call3",

"connection":"AzureADProvisioning",
"url":"https://graph.microsoft.com/v1.0/users/${response.call1.message.id}/manager/$ref",
"httpMethod":"PUT",
"httpParams":"{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${response.call2.message.id}\"}",
"httpHeaders":{"Authorization":"${access_token}"},
"httpContentType":"application/json",
"successResponses":{"statusCode":[200,201,204,205]},
"inputParams": {"dependentCall": true}}
]}
 

Log: 

"2024-02-05T09:48:09.842996208Z stdout F 2024-02-05 09:48:09,842 [quartzScheduler_Worker-5] ERROR rest.RestProvisioningService  - Call response: {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":[],"displayName":"Test Manager","givenName":"Test","jobTitle":"TestTitle","mail":"Test.Manager@mycompany.com","mobilePhone":null,"officeLocation":null,"preferredLanguage":null,"surname":"Manager","userPrincipalName":"Test.Manager@mycompany.com","id":"378b5331-89e9-437e-8a43-ebc0774401af"}"
"2024-02-05T09:48:09.843140508Z stdout F 2024-02-05 09:48:09,843 [quartzScheduler_Worker-5] ERROR rest.RestProvisioningService  - callResponseMap: [@odata.context:https://graph.microsoft.com/v1.0/$metadata#users/$entity, businessPhones:[], displayName:Test Manager, givenName:Test, jobTitle:TestTitle, mail:Test.Manager@mycompany.com, mobilePhone:null, officeLocation:null, preferredLanguage:null, surname:Manager, userPrincipalName:Test.Manager@mycompany.com, id:378b5331-89e9-437e-8a43-ebc0774401af]"
"2024-02-05T09:48:09.843149208Z stdout F 2024-02-05 09:48:09,843 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - showResponse: null"
"2024-02-05T09:48:09.843174908Z stdout F 2024-02-05 09:48:09,843 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - createNewUser - temp.status - Success"
"2024-02-05T09:48:09.843178008Z stdout F 2024-02-05 09:48:09,843 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - doBreak: false"
"2024-02-05T09:48:09.881410555Z stdout F 2024-02-05 09:48:09,881 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - connection: AzureADProvisioning"
"2024-02-05T09:48:09.980109817Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - Inside pullObjectsByRest"
"2024-02-05T09:48:09.980135717Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - "
"2024-02-05T09:48:09.980140017Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - calling executeRequestWithTimeoutConfig for api..."
"2024-02-05T09:48:09.980142417Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - calling api..."
"2024-02-05T09:48:09.980144917Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - before calling executeRequestWithHeaders for api..."
"2024-02-05T09:48:09.980173717Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - isFipsEnabled = false"
"2024-02-05T09:48:09.980187417Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - getHttpClient - proxyParams : null"
"2024-02-05T09:48:09.980204817Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - getHttpClient - sslSocketFactory : null"
"2024-02-05T09:48:09.980273617Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - setting connection timeout to 10 seconds and request timeout to 60 seconds"
"2024-02-05T09:48:09.980511717Z stdout F 2024-02-05 09:48:09,980 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - getHttpClient - HttpClientBuilder.create().build() called."
"2024-02-05T09:48:09.981551115Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - called executePutRequestWithHeaders for api..."
"2024-02-05T09:48:09.981559215Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - after calling executeRequestWithHeaders for api..."
"2024-02-05T09:48:09.981561715Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - called api..."
"2024-02-05T09:48:09.981563715Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - timeout validated for api..."
"2024-02-05T09:48:09.981565815Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG services.HttpClientUtilityService  - got response for api..."
"2024-02-05T09:48:09.981568015Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG rest.RestProvisioningService  - "
"2024-02-05T09:48:09.981575715Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG rest.RestUtilService  - pullObjectsByRest - responseStatusCode ::null"
"2024-02-05T09:48:09.981577915Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG rest.RestUtilService  - Got showLogs = true"
"2024-02-05T09:48:09.981639115Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] DEBUG rest.RestUtilService  - Got null response statusCode with erroMsg - [error:Error Illegal character in path at index 40: https://graph.microsoft.com/v1.0/users/${response.call1.message.id}/manager/$ref]"
"2024-02-05T09:48:09.981946515Z stdout F 2024-02-05 09:48:09,981 [quartzScheduler_Worker-5] ERROR rest.RestProvisioningService  - Exception in getting response in pullObjectsByRest :"
"2024-02-05T09:48:09.981953115Z stdout F java.lang.Exception: NullResponseFromTarget"
"2024-02-05T09:48:09.981955215Z stdout F    at com.saviynt.provisoning.rest.RestUtilService.checkForErrorMsg(RestUtilService.groovy:1463)"
"2024-02-05T09:48:09.981957115Z stdout F    at com.saviynt.provisoning.rest.RestProvisioningService.pullObjectsByRest(RestProvisioningService.groovy:4527)"
"2024-02-05T09:48:09.981959015Z stdout F    at com.saviynt.provisoning.rest.RestProvisioningService.createNewUser(RestProvisioningService.groovy:2781)"
"2024-02-05T09:48:09.981960815Z stdout F    at com.saviynt.provisoning.rest.RestProvisioningService$_createAccount_closure14.doCall(RestProvisioningService.groovy:2148)"
"2024-02-05T09:48:09.981962615Z stdout F    at com.saviynt.provisoning.rest.RestProvisioningService.createAccount(RestProvisioningService.groovy:1981)"
"2024-02-05T09:48:09.981964415Z stdout F    at com.saviynt.ecm.services.ArsTaskService.createAccountTarget(ArsTaskService.groovy:11844)"
"2024-02-05T09:48:09.981966215Z stdout F    at com.saviynt.ecm.services.ArsTaskHelperService$_whenTaskTypeIsThreeNewAccountAccess_closure50.doCall(ArsTaskHelperService.groovy:3079)"
"2024-02-05T09:48:09.981968115Z stdout F    at com.saviynt.ecm.services.ArsTaskHelperService.whenTaskTypeIsThreeNewAccountAccess(ArsTaskHelperService.groovy:3070)"
"2024-02-05T09:48:09.981969815Z stdout F    at com.saviynt.ecm.services.ArsTaskHelperService$_completeAutoProvTasksUpgraded_closure1.doCall(ArsTaskHelperService.groovy:175)"
"2024-02-05T09:48:09.981971615Z stdout F    at com.saviynt.ecm.services.ArsTaskHelperService.completeAutoProvTasksUpgraded(ArsTaskHelperService.groovy:160)"
"2024-02-05T09:48:09.981973415Z stdout F    at com.saviynt.ecm.services.ArsTaskHelperService.completeAutoProvTasksUpgraded(ArsTaskHelperService.groovy:91)"
"2024-02-05T09:48:09.981981115Z stdout F    at MultipleProvisioningJob.processInstProvTasks(MultipleProvisioningJob.groovy:489)"
"2024-02-05T09:48:09.981983215Z stdout F    at MultipleProvisioningJob$_processInstantProvTasks_closure15.doCall(MultipleProvisioningJob.groovy:767)"
"2024-02-05T09:48:09.981985315Z stdout F    at MultipleProvisioningJob.processInstantProvTasks(MultipleProvisioningJob.groovy:747)"
"2024-02-05T09:48:09.981987615Z stdout F    at MultipleProvisioningJob.execute(MultipleProvisioningJob.groovy:45)"
"2024-02-05T09:48:09.981989615Z stdout F    at org.quartz.core.JobRunShell.run(JobRunShell.java:199)"
"2024-02-05T09:48:09.981991515Z stdout F    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)"
 

call1 Response: 

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "id": "c789221b-3c54-4b87-bb3c-70d56e0e94c4",
    "businessPhones": [],
    "displayName": "Display Name",
    "givenName": "Firstname",
    "jobTitle": "Marketing Director",
    "mail": null,
    "mobilePhone": "+1 234 568461",
    "officeLocation": "131/1105",
    "preferredLanguage": "en-US",
    "surname": "Lastname",
    "userPrincipalName": "firstname.lastname@mycompany.com"
}
 

call2 Response:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "@microsoft.graph.tips": "This request only returns a subset of the resource's properties. Your app will need to use $select to return non-default properties. To find out what other properties are available for this resource see https://learn.microsoft.com/graph/api/resources/user",
    "businessPhones": [],
    "displayName": "DN_MANAGER",
    "givenName": "FN_ManagerTest008k",
    "jobTitle": "fasdf",
    "mail": "ManagerTest008@mycompany.com",
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": "LN_ManagerTest008k",
    "userPrincipalName": "ManagerTest008@mycompany.com",
    "id": "0bdb1d4f-623e-4024-ae99-6af995102367"
}
4 REPLIES 4

rushikeshvartak
All-Star
All-Star

Try

"url": "https://graph.microsoft.com/v1.0/users/${response.call1.message.id}/manager/\\$ref",


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

Murmur
Regular Contributor III
Regular Contributor III

Thanks @rushikeshvartak,

You are saving the day again!

I completely disregarded the secon $ as the error message said "Illegal character at index 40".

Cheers 🙂

 

iam01
Regular Contributor
Regular Contributor

Hey, what was fix here?

Murmur
Regular Contributor III
Regular Contributor III

Hi @iam01 

we used the solution proposed by rushik above: 

"url": "https://graph.microsoft.com/v1.0/users/${response.call1.message.id}/manager/\\$ref",