Anaplan REST - issue uploading file



I'm not Anaplan guy but doing an integation with Anaplan through the REST API.


Export of data works fine.


Issues come with the import. As first step, we have to upload the file.


We are using PowerShell but any feedback if other language is also welcome.


My question is: shall we use --upload-file in the url. In the API guide I can see xxx is the import file name. This is what we get from files REST resource:


id : 113000000010
name : Import to FDMEE template
chunkCount : 1
delimiter : "
encoding : ISO-8859-1
firstDataRow : 2
format : txt
headerRow : 1
separator : ,


Error when uploading --upload-file xxx
Invoke-RestMethod :

@import "lib/dojo/resources/dojo.css";
html {
overflow: auto;
An error has occurred whilst processing your request:

Not Found
Please close your browser window and try again.
If the problem persists then please contact Anaplan Support.

At C:\REST_Tester_Import.ps1:199 char:17
+ ... tResponse = Invoke-RestMethod -Uri $uri -Method Put -InFile $csvImpor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand