Hi, I was playing with REST API using powershell and I am stuck at an issue while uploading the document.
#Upload document
$Url = "http://localhost/otcs/llisapi.dll/api/v1/nodes"
$headers = @{
'OTCSTICKET' = "rg9nm0p2qYmlGnAbb9hDrktXYd8p6+X0cdjmCoGX/PNYKTy7hYOp2kS/rjJnihMg5neaI8DkWoWvfrgJss8YT9DyEd4cKWqT"
}
$Body=@{
type="144"
parent_id="9362"
name="Environment Details"
file="C:/Temp/EnvironmentDetails.txt"
description="environment details"
}
Invoke-RestMethod -Method Post -Uri $Url -Headers $headers -Body $Body
When I execute it, I receive an error "Error: File could not be found within the upload directory."
After some investigation I found that if I provide path of the files in upload directory specified in Content Server Server Parameters, file gets uploaded successfully but for any other path, I receive above error.
Has anyone encountered similar error? REST API documentation doesnt indicate that file has to be in Opentext upload folder.