Update Remote Session Credential ​
PUT /userapi/rscredentials
Updating an existing Remote Session Credential object can be achieved by making a PUT request on the URL, with appropriate fields forming the HTTP message body.
The user executing the API script must be given access to the following:
- On the screen Administration -> Feature Access -> Hosts tab : 'Specify which users are allowed to have access to the main Hosts Menu'
- On the screen Administration -> Feature Access -> Remote Sessions tab : 'Specify which users are allowed to add/edit/delete Remote Session Credentials from within the Hosts Menu'
- The user must have permissions to the Remote Session Credential
- If linking the Remote Session Credential to a password record, the user must have access to the password record
The PowerShell example below updates a Remote Session Credential record, linking a different Password record to the Remote Session Credential.
Powershell
#JSON data for the object
$Body = @{
CredentialID = "1011"
PasswordID = "32712"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/userapi'
$result = Invoke-Restmethod -Method Put -Uri $PasswordstateURL'/rscredentials' -ContentType "application/json" -Body $jsonData -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }
Write-Output $result