0

I am calling the Microsoft Graph API's to import user details into an application (which uses REST based connector) from Azure AD.

The application provides a variable (xyz) to be used in order to do incremental user imports.

I need to pass the application variable as ${xyz}. The Graph query seems to be confused about the $ symbol and is throwing an illegal character exception for the $ sign.

Below is the GET query used :

"https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName,mail,accountEnabled,onPremisesLastSyncDateTime&$count=true&$filter=onPremisesLastSyncDateTime%20ge%20${xyz}"

Error : [22;39mjava.lang.IllegalArgumentException: Illegal character in query at index 182:

Have tried to use $$, single quotes,backslash,` etc. to fix the issue, but none worked. Any help would be much appreciated.

2
  • Doesn't look like an error coming from Graph - you have a Java error. Do you actually substitute real data for the placeholder? Commented Dec 20, 2021 at 17:27
  • Have tried with real data and it has worked for me. Below is an example : graph.microsoft.com/v1.0/… The application converts the Variable into a real value during the runtime Commented Dec 21, 2021 at 10:04

1 Answer 1

0

As @Dmitry Streblechenko suggested, the error indicates that the variable does not have any real data.

If the real data is passed to the variable, the Graph API call runs successfully

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.