Add a New Address Book Contact ​
POST /userapi/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 have access to the feature 'Manage Global Contacts' on the screen Administration -> Feature Access -> Miscellaneous tab.
The PowerShell example below creates an Address Book record with various fields specified.
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/userapi'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/addressbook' -ContentType "application/json" -Body $jsonData -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }
Write-Output $result