Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Illegal character error in Web Service response

varunpuri
Regular Contributor
Regular Contributor

Hi,

I am getting an illegal character error in the logs when I am using the following web service call :

{
"name": "call2",
"callOrder": 1,
"connection": "${requestAccessAttributes.get('manager') != null && requestAccessAttributes.get('manager').length() > 0 ?'userAuthForB2C':''}",
"url": "${'https://graph.microsoft.com/v1.0/users?$count=true&$filter=userPrincipalName%20eq%20\\'' + requestAccessAttributes.get('manager').replaceAll(requestAccessAttributes.get('manager').substring(requestAccessAttributes.get('manager').indexOf('@')),'@domain.onmicrosoft.com') + '\\'&$select=id'}",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204,
205
]
}
}

This is the error I am getting :

"2024-04-12T11:25:57.258+00:00","ecm-worker","","null-k2t2c","","2024-04-12T11:25:56.775408681Z stdout F 2024-04-12 11:25:56,775 [quartzScheduler_Worker-3] DEBUG rest.RestProvisioningService - Got Webservice API Response: [error:Error Illegal character in scheme name at index 0: ${'https://graph.microsoft.com/v1.0/users?$count=true&$filter=userPrincipalName%20eq%20\'' + requestAccessAttributes.get('manager').replaceAll(requestAccessAttributes.get('manager').substring(requestAccessAttributes.get('manager').indexOf('@')),'@domain.onmicrosoft.com') + '\'&$select=id'}]"

Kindly help resolve.

Best Regards,
Varun

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Issue is with url


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hello @rushikeshvartak 

I understand that, but can you help in pointing out the issue exactly. If i use the below URL, then it works - 
"url": "${'https://graph.microsoft.com/v1.0/users?$count=true&$filter=mail%20eq%20\\'' + requestAccessAttributes.get('manager') + '\\'&$select=id'}"

Is there any problem with the replaceAll method ? The same method with the same logic is working fine in another part of the same JSON.

Best Regards,
Varun

NM
Regular Contributor III
Regular Contributor III

Hi @varunpuri, escape the dollar sign before filter use ... \\$