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

Provisioning Manager in Azure - REST Connector

pivitale
New Contributor III
New Contributor III

Hello,

we want to write the Object ID of a user's manager in azure by using the the rest connector, do you have any idea on how to satisfy this requirement? 

pivitale_0-1655716295981.png

The manager's object ID is stored in the manager's Azure account in Saviynt.

Any suggestion?

Thank you!

3 REPLIES 3

avinashchhetri
Saviynt Employee
Saviynt Employee

Hello Pivitale,

You could try using the JSON below :

 

{
"name": "call1",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users/${account.accountID}/manager/\\$ref",
"httpMethod": "PUT",
"httpContentType": "application/json",
"httpParams": "{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${managerAccount.accountID}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"successResponses": {
"statusCode": [
204
]
},
"unsuccessResponses": {
"odata~dot#error.code": "Request_BadRequest,Authentication_MissingOrMalformed,Request_ResourceNotFound,Authorization_RequestDenied,Authentication_Unauthoriz"
}
}

 

 

Regards,

Avinash Chhetri

Regards,
Avinash Chhetri

JustSalva
Regular Contributor
Regular Contributor

Hi, 

We tried the solution in UpdateAccountJSON and works correctly, but if we try to do the same in CreateAccountJSON the parameter ${account.accountID} is not populated correctly, since the account does not exist yet.

We tried the following CreateAccountJSON:

{
"accountIdPath": "call1.message.id",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"displayName": "call1.message.displayName~#~char",
"name": "call1.message.userPrincipalName~#~char",
"accountID":"call1.message.id~#~char"
},
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users",
"httpMethod": "POST",
"httpParams": "{\"onPremisesImmutableId\" :\"${user.username}\",\"employeeId\" :\"${user.customproperty1}\",\"displayName\" :\"${user.firstname} ${user.lastname}\",\"givenName\" :\"${user.firstname}\",\"surname\" :\"${user.lastname}\",\"userPrincipalName\" :\"${user.firstname}.${user.lastname}@calzedoniatst.com\",\"mobilePhone\" :\"${user.phonenumber}\", \"businessPhones\": [\"${user?.secondaryPhone=='[]'? '': user.secondaryPhone}\"],\"jobTitle\" :\"${user.title}\",\"companyName\" :\"${user.companyname}\",\"department\" :\"${user.departmentname}\",\"officeLocation\" :\"${user.location}\",\"employeeType\" :\"${user.employeeType}\",\"accountEnabled\" :true,\"userType\":\"Member\", \"mailNickname\": \"${user.firstname}.${user.lastname}\",\"passwordProfile\": {\"forceChangePasswordNextSignIn\": false,\"password\": \"ncdj!xCvZa\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204,
205
]
}
},

{
"name": "call2",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users/${account.accountID}/manager/\\$ref",
"httpMethod": "PUT",
"httpContentType": "application/json",
"httpParams": "{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${managerAccount.accountID}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"successResponses": {
"statusCode": [
204
]
},
"unsuccessResponses": {
"odata~dot#error.code": "Request_BadRequest,Authentication_MissingOrMalformed,Request_ResourceNotFound,Authorization_RequestDenied,Authentication_Unauthoriz"
}
}
]
}

we tried also to substitute ${account.accountID} with ${call1.message.id} hoping to retrieve the id from the previous call response, but it does not work either.

 

Can you suggest a way to retrieve the user id from call1?

Thank you

Matteo

In your second call, try the url parameter like this :

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

 

 

Regards,

Avinash Chhetri

 

 

Regards,
Avinash Chhetri