Delete Remote Session Credential ​
DELETE /userapi/rscredentials
Deleting an existing Remote Session Credential object can be achieved by making a DELETE 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
The PowerShell example below deletes the Remote Session Credential record, based on the CredentialID field. The Description field can also be used here, as long as the Description is unique in the database.
Powershell
#JSON data for the object
$Body = @{
CredentialID = "1011"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/userapi'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/rscredentials' -ContentType "application/json" -Body $jsonData -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 204 No Content