02/01/2023 03:07 AM - edited 02/01/2023 03:08 AM
I'm trying to implement REST connector to import users from Azure AD into Saviynt.
REST connector is configured, and this is ImportUserJSON field:
{
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users?$select=Id,userPrincipalName,accountEnabled,mail,userType,createdDateTime,country,preferredLanguage,displayName,surname,givenName,mobilePhone,businessPhones,mailNickname,mail,companyName,jobTitle,department,usageLocation,state,officeLocation,city",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"username": "userPrincipalName~#~char",
"displayname": "displayName~#~char",
"firstname": "givenName~#~char",
"lastname": "surname~#~char",
"country": "country~#~char",
"phonenumber": "mobilePhone~#~char",
"statuskey": "accountEnabled~#~char",
"email": "mail~#~char",
"employeeType": "userType~#~char",
"companyName": "companyName~#~char",
"title": "jobTitle~#~char",
"departmentname": "department~#~char",
"location": "usageLocation~#~char",
"customproperty2": "Id~#~char",
"state": "state~#~char",
"customproperty1": "officeLocation~#~char",
"city": "city~#~char",
"phonenumber": "mobilePhone~#~char",
"startdate": "createdDateTime~#~char"
},
"userResponsePath": "value",
"pagination": {
"nextUrl": {
"nextUrlPath": "${(response?.completeResponseMap?.get('@odata.nextLink')==null)? null : response?.completeResponseMap?.get('@odata.nextLink')}"
}
}
}
This indeed works, and ALL users are imported fromo Azure AD.
However, I want to filter them, and import only subset of users based on companyName attribute.
If I change url and add &$count=true&$filter=companyName eq 'Company name' at the end, ImportUsersJob breaks and no user is imported.
Is there any other way to filter users on the import from Azure AD using REST connector?
Solved! Go to Solution.
02/01/2023 03:30 AM
URL breaks as it's with space & single quotes which needs to be replaced with ASCII Character set. Refer URL encoding for more clarity - https://www.w3schools.com/tags/ref_urlencode.ASP
Space replaced with %20
Singlequote replaced with %27
https://graph.microsoft.com/v1.0/users?$select=Id,userPrincipalName,accountEnabled,mail,userType,cre...$filter=companyName%20eq%20%27Company%20name%27
Hope this helps!
-Siva