Send Self Destruct Message ​
POST /winapi/selfdestruct
The PowerShell example below creates an Self Destruct message, based off of a password record, with the various Self Destruct settings available. Please refer to the section Self Destruct Messages for all available settings.
Powershell
#JSON data for the object
$Body = @{
PasswordID = $PasswordID
ExpiresAt = "1d"
FromUserID = "domain\fbloggs"
FromFirstName = "Fredd"
FromSurname = "Bloggs"
FromEmailAddress = "fbloggs@domain.com"
ToEmailAddress = "recipient@domain2.com"
ToFirstName = "John"
NoViews = "1"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/selfdestruct' -ContentType "application/json" -Body $jsonData -UseDefaultCredentials
Write-Output $resultJson
# Response
HTTP/1.1 200
[
{
"SelfDestructMessageURL":"https://passwordstate/selfdestruct/?id=<MessageID>"
}
]