Download A File Using API V1.3 - Do I Always Need to Delete File First?
I finally have gotten around to asking this question that's been bothering me since I started using the APIs to download a file. I get inconsistent results when I test this on my own so I thought I'd ask the Community.
The use case: I want to download a file (export) based on a view from a module using API v1.3 (Basic Auth is fine)
The most reliable steps I found to get an updated file download from a changed view is to:
Create the export manually and run the action in Anaplan. (Use Postman or Python to get the fileID)
From the API, Delete The File
From the API, Run the Export Action
From the API, Download The File
My question is do I always need to delete the file first before running the export? If not, what are the conditions that necessitate a file deletion first?
Two things to consider:
I know delete file only works on private files. I'll get a 204 error if I try to delete an "admin" or "everyone" file. If I use an "everyone" file, can I just skip the delete file and always get an updated copy?
If the view changes that creates the export, some type of action seems to be needed to get the new view. Is that a delete file? If that's the case, how do i do this if I use an "everyone" export? Do I have to run it manually first in Anaplan?
I think something happens when the view that is used to create the export changes.
For some reason when I run the export and the download actions via the API, I get the old data. But if I delete the file first (assuming I can) then run the export and download, I get the new data in the new view.
The problem is I can't make this happen consistently. Sometimes I just have to re-run the export manually from within Anaplan to get it to work.
So between the changing view and the type of save (private, admin, everyone) there's a specific combination that needs to be used.