Authentication ​
This version of the User Based API uses user specific API Keys. When a script is executed under the identity of a user's account, all access to data is the same as if the user were to login to the Passwordstate web site.
Important: Below is an example where you specify the UserID and APIKey in the header request for your scripts. User's get set their API Key on the Preferences screen in Passwordstate.
Powershell
# PowerShell Request
$PasswordstateUrl = 'https://passwordstate/userapi/passwordlists/<PasswordListID>'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 200
[
{
"AllowExport": true,
"AuthenticationPerSession": false,
"AuthenticationType": "None Required",
"CodePage": "Unicode (UTF-8)",
"Description": "Various web sites on the net",
"ForcePasswordGenerator": false,
"GeneratorName": "Default Password Generator",
"Guide": "",
"HidePasswords": "false:false:false",
"ImageFileName": "website.png",
"PasswordGeneratorID": 1,
"PasswordList": "Web Site's",
"PasswordListID": 27,
"PasswordResetEnabled": false,
"PasswordStrengthPolicyID": 7,
"PolicyName": "SQL Server Policy",
"PreventBadPasswordUse": true,
"PreventDragDrop": true,
"PreventExpiryDateModification": false,
"PreventPasswordReuse": 5,
"PrivatePasswordList": false,
"ProvideAccessReason": true,
"ResetExpiryDate": 0,
"SetExpiryDate": 0,
"ShowGuide": false,
"TimeBasedAccessRequired": false,
"NoApprovers": "1",
"DisableNotifications": false,
"TotalPasswords": 23,
"TreePath": "\ISP Accounts",
"SiteID":"0",
"SiteLocation":"Internal"
}
]