Help needed with Rest API file upload (using R if possible)
Hello everyone, I am trying to upload a file onto anaplan from R and haven't been successful for quite a bit of time.
I will list down the steps I have taken and it would be greatly appreciated if anyone can help
1. Created a file in anaplan and set the option to "Admins Only". The file name is driver_coeff_template.csv
2. Created an import action that uses this file to update data in a module
3. Here are the actions that i run through R. I will attach the script that has i built using the RestAPI documentation. The first one is authentication, i am able to login and generate a token.
4. Using GET to fetch file details
5. Using POST to set chunk count to -1. (The file that needs to be uploaded is very small usually ~100 KB)
6. Using PUT to upload file. The upload file has data as shown below in the screenshot. Also this step always seems to return NULL as response in R.
7. Using POST to mark upload as complete. Once this is done, i checked out the file in anaplan
It seems that part of the file has been loaded which is the first column "Estimate" but the row positions are changed and i am missing the other columns.
Would really help any help on this and as mentioned before, i have attached the R code as well in a text file. The code simply uses the URLs for the api and has functions for headers as well as body that has to be sent in case anyone find it hard to understand. I have looked at the discussion a few times https://community.anaplan.com/t5/Anaplan-Platform/Uploading-file-Via-REST-API-and-Triggering-Imports/m-p/51791#M7821 as well as the Rest API videos in https://community.anaplan.com/t5/How-To/RESTful-API-How-To/ta-p/33579 but haven't been able to get the upload right.