and more in a single search tool across platforms. Read the announcement here. |
02/21/2023 09:45 PM
Q) How to encode the URL dynamically as the entitlement_value could be of multiple ' ' (spaces) and different special character?
Problem: Saviynt is not able to parse the URL and throws : java.net.URISyntaxException error.
Note: You cannot pass entitlementID (Unique entitlement id/group id) to URL.
Any suggestions will be appreciated.
Thanks
Solved! Go to Solution.
02/27/2023 09:13 PM - edited 02/27/2023 09:55 PM
For multiple spaces you can use double invited commas in the url like below
Generally we recommend to use entitlement id or any other field which is unique.
02/27/2023 09:53 PM
You can use below encoder function to encode spaces and all special characters.
url": "http://xxxxxxxxx?userid=${account.name}&groupname=${URLEncoder.encode(entitlementValue.entitlement_v..., \"UTF-8\").replace(\"+\", \"%20\")}"
02/27/2023 10:06 PM
@mayankshah Thanks for updating the solution
03/31/2023 01:31 PM
I am trying above mentioned solution but its not working , please let me know any corrections/inputs , we are using this URL https://xxxxxxx.aha.io/api/v1/products/${URLEncoder.encode(entitlementValue.entitlementID, \"UTF-8\").replace(\"+\", \"%20\")}
Caused by: java.net.URISyntaxException: Illegal character in path at index 40: https://xxxxxxx.aha.io/api/v1/products/${URLEncoder.encode(entitlementValue.entitlementID, \"UTF-8\").replace(\"+\", \"%20\")}\u001b[m\n","stream":"stdout","time":"2023-03-31T20:25:28.506808419Z"}
04/03/2023 04:53 AM
Hi @IAM_99
Why are you trying to replace characters in EntID as its a numeric value?
Also the Url looks correct , as error is saying index 40 then it looks like when it is starting the double quote. Also if you are able to call this url via postman?
Thanks
Darshan
04/03/2023 06:30 AM
Hi Darshan
We are calling from Saviynt ( error is from saviynt logs)
This is the URL https://xxxxxxx.aha.io/api/v1/products/6603028474658293963/users
Product Id ( bolded) /entitltlemtntID has to be passed dynamically when requesting.
04/03/2023 06:40 AM
Hi @IAM_99
Yes , If you are passing the above url in postman is it working fine?
Also if you see the above url you can directly use entitlement why do you need to replace anything as entitlementID is the numeric string. ( its fine that you want to pass it dynamically )
https://xxxxxxx.aha.io/api/v1/products/${entitlementValue.entitlementID}
Thanks
Darshan
04/03/2023 07:15 AM - edited 04/03/2023 07:16 AM
Yes below works in PSOTMAN -
https://xxxxxxx.aha.io/api/v1/products/6603028474658293963/users
Same has been converted in Saviynt , each time user selects an entitlement(productid) that value has to be passed in URL so we are using https://xxxxxxx.aha.io/api/v1/products/${entitlementValue.entitlementID}
Issue start with $ ( it says illegal charector 40 th), its not able to resolve.
${entitlementValue.entitlementID}
Connector screenshot
~~~~~~~~~~~~~~~~~~~~~~~~~~
04/03/2023 07:25 AM
Hi @IAM_99
Make sure you are using flower brackets inside dollar {} . If you still face a issue, would suggest you to raise a Freshdesk ticket so that support team can check the issue fully.
Thanks
Darshan
04/03/2023 07:35 AM
Could you elaborate this - "flower brackets inside dollar {} "
Below is Valid right ? i am using exactly same
https://xxxxxxx.aha.io/api/v1/products/${entitlementValue.entitlementID}/users
Yeah created FD ticket 5 days yet to see a response.
04/04/2023 01:41 AM
Hi @IAM_99
As checked You were using this in create account json and the binding variables ${entitlementValue.*} is only exposed in add access json. Here the system is calling the create account as account is not present hence it is throwing an error.
04/04/2023 06:28 AM
Hi Darshan,
We have create Account and Add Access both has same api ( we need to pass entitlementValue).
Below screen is another REST app which is working with the variable.
04/04/2023 06:54 AM
Hi @IAM_99
No this is not exposed there may be issue with that app as well , you can check the logs.
It is clear that only user and account objects are exposed in create account. ( if you still differ you can attach the logs of working json with showlogs=true where we can check how it is taking that variable in create account )
Thanks
Darshan