Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/23/2024 08:06 AM
Hello,
We have a customer requirement to update organization owner as manager to Azure AD guest accounts from saviynt.
We tried below JSON but no luck, CP10 stored the value of owner userprincipalname
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users/${account.accountID}/manager/\\$ref",
"httpMethod": "PUT",
"httpParams": "{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${usersManagerObj?.customproperty10}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 204, 205]
}
}
]
}
can anyone suggest alternative way to achieve this?
FYI, we are in 23.9
Regards,
Chandan Gowda
Solved! Go to Solution.
09/23/2024 08:08 AM
09/23/2024 09:46 AM
I tried smoke test to see the result,
09/23/2024 09:48 AM
Share logs
09/23/2024 10:12 AM
{"headers":null,"message":{"error":{"code":"BadRequest","message":"The request URI is not valid. Since the segment 'users' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource."}},"statusCode":400,"description":null,"status":"Failed"},
09/23/2024 10:47 AM
Hardcode value and validate
09/23/2024 10:54 AM
I tried and it worked, also tried the below JSON and worked
{
"name": "call2",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users/${account.accountID}/manager/$ref",
"httpMethod": "PUT",
"httpParams": "{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${user.customproperty10}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 204, 205]
}
}
Now, i need to call 2 URL's with different conditions for update account. i tried below JSON but no luck
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users/${account.accountID}",
"httpMethod": "PATCH",
"httpParams": "{\"onPremisesExtensionAttributes\": {\"extensionAttribute9\": \"${user.username}\"}}",
"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",
"httpParams": "{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${user.customproperty10}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 204, 205]
}
}
]
}
09/23/2024 10:55 AM
what will be condition or logic needed in call2?
09/24/2024 04:36 AM
If i call individually, both works but if i call together(call1 & call2) it's not
we need to call both call1 and call2 together in UPDATEACCOUTJSON, below is the JSON that i was used
{
"accountIdPath": "call2.message.id",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://graph.microsoft.com/v1.0/users/${account.accountID}",
"httpMethod": "PATCH",
"httpParams": "{\"onPremisesExtensionAttributes\": {\"extensionAttribute9\": \"${user.username}\"}}",
"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",
"httpParams": "{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/${user.customproperty10}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 204, 205]
}
}
]
}
09/24/2024 06:47 AM
Please share logs
09/27/2024 03:50 AM
Below JSON worked,
UPDATEACCOUNTJSON:
{"call": [
{
"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"
}
}
]
}