Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

We are using AddAccess JSON to create account, is there any way we can use if else condition to see

VijayMaram
New Contributor
New Contributor

Hi Team,

We are using AddAccess JSON to create account, is there any way we can use if else condition to see account is already present. Because when ever we task created process trying to call create account json as it present very first.

If we create account along with access and this complted.

next we request for new entitlement then createuser api calling and process failed forever. 

{
"call": [
{
"name": "Groups",
"connection": "acctAuth",
"url": "https://*********/SecurityService/CreateUser",
"httpParams": "{\"Username\": \"${user.username}\", \"Active\": true, \"AccountType\": 1, \"FirstName\": \"${user.firstname}\", \"LastName\": \"${user.lastname}\", \"EmailAddress\": \"${user.email}\", \"IsSAML\": true, \"SecurityConfiguration\": {\"Id\": 7}, \"APIAccess\": false, \"Groups\": [{\"Id\": \"${entitlementValue.entitlementID}\"}], \"SecurityRoles\": [{\"Id\": 12}]}",
"httpHeaders": {
"Cookie": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
},
{
"name": "Groups",
"connection": "acctAuth",
"url": "https://******.com:4443/SecurityService/UpdateGroup",
"httpParams": "{\"Id\": \"${entitlementValue.entitlementID}\", \"Users\": [{\"Id\": \"${account.accountID}\"}]}",
"httpHeaders": {
"Cookie": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
500,
501
]
}
}
]
}

 

 

2024-06-26T15:17:59-05:00-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-7-td4vx-DEBUG-Calling Webservice Url - https://*******3/SecurityService/CreateUser with httpParams - [Username:test_v_keylight4, Active:true, AccountType:1, FirstName:test, LastName:v, EmailAddress:null, IsSAML:true, SecurityConfiguration:[Id:7], APIAccess:false, Groups:[[Id:803]], SecurityRoles:[[Id:12]]]

803 is new entitlementID.

 

Got Webservice API Response: headers:[Cache-Control: no-cache, no-store, must-revalidate, Pragma: no-cache, Content-Type: application/json, Expires: -1, Server: , Strict-Transport-Security: max-age=31536000; includeSubDomains; preload, X-ASPNET-VERSION: , X-POWERED-BY: , Date: Wed, 26 Jun 2024 20:17:59 GMT, Content-Length: 64], responseText:{"Message":"This username is already in use.","StackTrace":null}, cookies:
 
2024-06-26T15:18:00-05:00-ecm-worker-rest.RestUtilService-quartzScheduler_Worker-7-td4vx-DEBUG-pullObjectsByRest - responseStatusCode ::400

 

 

 

1 REPLY 1

rushikeshvartak
All-Star
All-Star

Use callcondition or multiple call 

  • call 1 validation if account exists or not
  • call 2 if nor exists create account
  • call 3 add access

refer https://forums.saviynt.com/t5/tag/callcondition/tg-p/board-id/iga


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.