Add a Folder Document ​
POST /api/document/folder/
Uploading a new Folder Document can be achieved by making a POST request on the URL, with appropriate fields forming the QueryString of the URL. To upload documents, you must use the API Key from the specific Folder, or the Documents API key available on the screen Administration -> System Settings -> API.
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/api/document/folder/<FolderID>?DocumentName=<DocumentName>&DocumentDescription=<DocumentDescription>"
$result = Invoke-RestMethod -Uri $uri -Method Post -InFile $documentPath -ContentType 'multipart/form-data' -Header @{ "APIKey" = "<apikey>" }
Write-Host $resultJson
# Response
HTTP/1.1 200
[
{
"DocumentID": 126,
"DocumentName": "Build-Specifications.txt"
}
]