I am looking to integrate Oracle SOA with Anaplan, specifically my requirement is to feed data from a Oracle SOA BPEL to Anaplan.
I have gone through the Anaplan API documentation and looking to use Upload and Import APIs.Approach I am planning to follow is write the content from Oracle SOA to a file and then upload that file to the Anaplan server.I have created a sample file from the Anaplan UI.
My questions are:
1.Is it possible to use these APIs from http client, to start with I am testing these APIs using Postman.I could call the Get File ID API to get the file Id of the sample file I have created in Anaplan.But I am not successful in executing the Upload API to upload the file from local.
2.How to specify the local file path in the Upload API.As I see the format of the API as 'https://api.anaplan.com/1/3/workspaces/workspaceID/models/modelID/files/fileId --upload-file Tests.txt' , how can the upload file name can be specified like this --upload-file Tests.txt from http client. If I run it, I get error
<div id="pageWrap" class="pageWrap">
<div class="banner">
<h1>An error has occurred whilst processing your request:</h1>
</div>
<div>
<pre class="original">Not Found</pre>
</div>
<div>Please close your browser window and try again.</div>
<div>If the problem persists then please contact Anaplan Support.</div>
</div>
Please help in getting this implemented.
Hi,
1: yes it does work from postman.
In the documentation you also have an incorporated web client
2: I don't know if it's the only solution but when I upload a file I do open the content of that file in my script and then send it as the body of the http request.
Thanks Nathan for the response.
The link you shared for the incorporated webclient is taking me to the API that lists the workspace ID and not to the information about the webclient.
As I have a little knoweldge about Anaplan and the scripts, I am assuming from your response that when we send the Upload request from Postman, the https://api.anaplan.com/1/3/workspaces/workspaceID/models/modelID/files/fileId has to be called with the content of file added in some format in the body.
I would be great if you can share me a sample script which send the content(in the expected format) as the body of the request
Thanks,
Divya
yes, I was just point to my own bookmark, upload is here:
If you want to run that upload from POSTMAN, I believe you need to put the actual content of the file inside the body.
It's probably a CSV so just copy in there the text
I am currently using Postman to try out these APIs.I have the valid workspace Id and Model ID and using which I could call the GetFileID API and I could see the fileID of the file I am looking to upload.
As you mentioned ' The body of the request must contain the content you want to upload', this is what I am not clear with, should the file be send as attchment to the Upload API(PUT operation) or if the content has to be in the body what should be the content type and the format of the content.
As Nathan suggested, I tried to paste the content in body but it threw htpp 415 error, Unsupported Media Type.
Thanks,
Divya
Hi @ben_speight and @DivyaHabin
I'm trying to understand the same thing and here is what I did
1.) I have my Workspace, Model and File defined in request
2.) In headers I have Authorization and Content-Type defined (Basic and application/octet-stream)
3) In body I put --upload -file to key and attached file as value since in Postman you can do that
End result looks like this:Postman
Any ideas what I can try next?
By the way, I am trying to upload material from 102 Introduction to Model Building (1.0) to its workspace, so if we can get ths working, it will be nice example for new Anaplanners
With binary I got:404