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

Need DisableAccountJson for Sav4Sav REST connector

Diptansu_Sinha
New Contributor II
New Contributor II

Hello Team , 

we are using traditional rest connector for Sav4Sav connection. However we need disableaccountjson for the this REST connection. We have checked in documentation but what API URL will be responsible for disabling accounts ?

 

We are using below json seems its not working:

{"actions":{"Disable User":{"call":[{"name":"call1","connection":"userAuth","url":"
https://XXXX/ECM/api/v5/updateUser","httpMethod":"DELETE","httpHeaders":{"Authorization":"${access_token}"},"httpContentType":"application/json","successResponses":[{"message":"User
disabled Successfully"}]}]}}}

 

 

2 REPLIES 2

Falcon
Saviynt Employee
Saviynt Employee

Disclaimer - This is an AI generated response and the feedback on this thread will be used to further fine tune.

Given your scenario and the provided documentation details for updating a user in a Saviynt to Saviynt (Sav4Sav) connection, the correct approach to disable a user account should involve a POST or PUT HTTP method rather than DELETE. The DELETE method is generally used for removing resources and is not appropriate for merely updating a user's status to disabled. Instead, you should update the user's statuskey or a similar attribute as per the API's specification to disable the account.

Considering the documentation's guidelines and your existing configuration, here is a revised version of your DisableAccountJSON configuration that aligns with the described API behavior for disabling a user account:

 

{
  "actions": {
    "Disable User": {
      "call": [
        {
          "name": "call1",
          "connection": "userAuth",
          "url": "https://XXXX/ECM/api/v5/updateUser",
          "httpMethod": "POST",
          "httpHeaders": {
            "Authorization": "Bearer ${access_token}",
            "Content-Type": "application/json"
          },
          "httpContentType": "application/json",
          "httpParams": "{\"username\": \"${user.username}\", \"statuskey\": \"0\"}",
          "successResponses": {
            "statusCode": [200, 201]
          }
        }
      ]
    }
  }
}

 

Key Adjustments:

  1. HTTP Method: Updated from DELETE to POST, which is appropriate for sending data to the server to create/update a resource, in this case, to disable a user account. If the API also supports PUT, you can use PUT instead of POST based on your specific use case or API recommendation.

  2. Authorization Header: Corrected to use the "Bearer" scheme followed by the token as specified in the documentation. Make sure to replace ${access_token} with the actual token at runtime.

  3. Content-Type Header: Confirmed as "application/json" to match the payload format you're sending.

  4. httpParams: Updated to a JSON string format including mandatory parameters. Based on the provided documentation, it's essential to specify at least one identifying parameter (username or propertytosearch) and any other attributes you wish to update, such as statuskey to "0" for disabling the account. Replace ${user.username} with the actual username of the account you intend to disable.

  5. successResponses: Adjusted to expect 200 OK or 201 Created as success status codes, which are common responses for successful POST requests.

Ensure you replace "https://XXXX/ECM/api/v5/updateUser" with the actual API endpoint provided by your Saviynt environment. Also, replace ${user.username} with the appropriate dynamic variable that references the username of the account you're disabling. This configuration assumes that setting statuskey to "0" effectively disables the user account as per your system's logic.

rushikeshvartak
All-Star
All-Star

Try below JSON

{
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://${connection.hosturl}/ECM/api/v5/updateAccount",
"httpMethod": "POST",
"httpParams": "{\"securitysystem\":\"Saviynt\",\"endpoint\":\"Saviynt\",\"name\":\"${user.username}\",\"status\": \"2\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}


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