Anaplan REST - issue uploading file

Hi,

 

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

https://api.anaplan.com/1/3/workspaces/8a81b08e4f13b5e3014f281bcca564e9/models/883833FE74FA4CE58969ADD043C630CA/files/113000000010 --upload-file xxx
Invoke-RestMethod :

Anaplan
@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

Answers