Add a Password List Document ​
POST /userapi/document/passwordlist/
Uploading a new Password List Document can be achieved by making a POST request on the URL, with appropriate fields forming the QueryString of the URL.
Note: It's not possible to specify the Document Name and Description in the BODY of the HTTP Post, as this is where the document is uploaded from.
Powershell
# PowerShell Request
$documentPath = "D:\Build-Specifications.txt"
$uri = "https://passwordstate/userapi/document/passwordlist/<PasswordListID>?DocumentName=<DocumentName>&DocumentDescription=<DocumentDescription>"
$result = Invoke-RestMethod -Uri $uri -Method Post -InFile $documentPath -ContentType 'multipart/form-data' -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }
Write-Host $resultJson
# Response
HTTP/1.1 200
[
{
"DocumentID": 126,
"DocumentName": "Build-Specifications.txt"
}
]