Retrieving Password History ​
GET /api/passwordhistory
You can retrieve all the history for a Password object by specifying the PasswordID & APIKey values, with a simple GET request.
In addition to the standard fields for a Password object, there are a few more which need to be explained:
| Heading | Data Type | Description |
|---|---|---|
| PasswordID | Integer | Unique identifier for the Password object |
| DateChanged | DateTime | The date and time the Password object was updated, and the Password History record added. |
| PasswordList | String | The name of the Password List the history records belongs to. |
| UserID | String | The UserID of the user who made the change to the Password object. This UserID will also show the value of 'WebAPI' if the Password was updated via the API. |
| FirstName | String | The First Name of the user who made the change to the Password object. |
| Surname | String | The Surname of the user who made the change to the Password object. |
Powershell
# PowerShell Request
$PasswordstateUrl = 'https://passwordstate/api/passwordhistory/<PasswordID>'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Header @{ "APIKey" = "<apikey>" }Json
# Response
[
{
"PasswordHistoryID": 6319,
"Title": "forum4_counter3",
"UserName": "login2",
"Description": "My login to forum4",
"GenericField1": "loginasa",
"GenericField2": "",
"GenericField3": "",
"GenericField4": "",
"GenericField5": "",
"GenericField6": "",
"GenericField7": "",
"GenericField8": "",
"GenericField9": "",
"GenericField10": "",
"GenericFieldInfo": [],
"AccountTypeID": 0,
"Notes": "",
"URL": "http://www.microsoft.com",
"Password": "gin-hid-bud-9uXmoJzgdHNp",
"ExpiryDate": "15/01/2013",
"DateChanged": "15/01/2013 12:29:07 PM",
"PasswordList": "Web Site's",
"UserID": "domain\jbloggs",
"FirstName": "Joe",
"Surname": "Bloggs",
"PasswordID": 46411,
"AccountType": ""
},
{
"PasswordHistoryID": 6318,
"Title": "forum4_counter3",
"UserName": "login2",
"Description": "My login to forum4",
"GenericField1": "loginasa",
"GenericField2": "",
"GenericField3": "",
"GenericField4": "",
"GenericField5": "",
"GenericField6": "",
"GenericField7": "",
"GenericField8": "",
"GenericField9": "",
"GenericField10": "",
"GenericFieldInfo": [],
"AccountTypeID": 0,
"Notes": "",
"URL": "http://www.microsoft.com",
"Password": "bye-be-ere-RnQ19LWuAwSyJh",
"ExpiryDate": "15/01/2013",
"DateChanged": "15/01/2013 12:28:48 PM",
"PasswordList": "Web Site's",
"UserID": "WebAPI",
"FirstName": "Passwordstate",
"Surname": "Web API",
"PasswordID": 46411,
"AccountType": ""
},
...
]