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.
Comments
-
hi ben, @ben_speight could you please elaborate a bit more on this, finding it hard to understand as i am not very well versed with APIs
0 -
Let me try this @ben_speight and will let you know what happens
0 -
thank you so much @ben_speight , this worked out perfectly for a single chunk file. Been at this for a while so really appreciate the help.
0
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways