Add a Address Book Contact ​
POST /api/addressbook
Adding a new Address Book contact can be achieved by making a POST request on the URL, with appropriate fields forming the HTTP message body. To create Address Book contacts, you must use the Self Destruct and Address Book API Key.
The PowerShell example below creates an Address Book record with various fields specified. API Key can be specified in the Header, or the Body of the POST.
Powershell
#JSON data for the object
$Body = @{
FirstName = "Graham"
Surname = "Sanders"
EmailAddress = "gsanders@gmail.com"
Company = "Sanders Pty Ltd"
Country = "United States"
PassPhrase = "Pas$Fraze1865"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/addressbook' -ContentType "application/json"-Body $jsonData -Header @{ "APIKey" = "<apikey>" }
Write-Output $result