Hello,
I have a question about using the Anaplan integration API V2 guide. Is it possible to upload a csv document inside a .zip file to Anaplan? I'm able to manually upload a zip file with a csv in it, which works, but cannot figure out if its possible to do it with the API. I'm trying to do this with Postman but the data being received in Anaplan is all binary. I'm basically trying to accelerate my uploads via the api using large zipped files. Do I need to post with a certain header? I'm not sure if this is possible or not?
My only headers are:
'Authorization: AnaplanAuthToken bla'
'Content-Type: application/octet-stream'
Thanks,
Tom
Solved! Go to Solution.
It is not possible with Anaplan Connect. Below is the excerpts from Anaplan Integration guide. But I am not aware how REST API behaves. I believe it should fall on the same lines
Thanks,
Misbah
First of all Excellent question !
You need
Hope this helps
I hope your request method is POST
Perhaps share your postman screenshots so that i can debug
Was using a PUT, which was working with a plain CSV. Just tested with POST, same bad response. Maybe its the way i'm uploading the file?
Headers:
Body:
Response:
Thanks
your URL looks like you are uploading file as single chunk ? I cannot see the entire URL but i can make out with 80% accuracy as you have file/some file ID
If this is TRUE then you cannot compress the file and load . It defeats the purpose . Uploading a file as single chunk means your file size is small(less than 1 mb) therefore you dont need to compress and you PUT it onto the server by streaming it as an octet stream.
you need to Chunk the file into smaller parts and then use gzip application method
in other words your URL should look like below
/workspaces/{workspaceID}/models/{modelID}/files/{fileId}/chunks/{chunkId} -X --upload-file chunk-aa
if you need more info on chunking please refer to
https://anaplanbulkapi20.docs.apiary.io/#reference/upload-files under Upload a file in chunks
I just tested it out again and splitted a file into the chunks and converted into gzip and it worked, Thank you. I had also tested another method:
- I gzip'ed a single file, posted the chunk count of 1,
-Then in my upload url I had to switch it to {fileid}/chunks/0 , instead of the /{fileid} by itself
- Then uploaded it with a single gzip compressed file.
And it worked!
Thanks!