I have built a logic app that moves files into temporary folders until all associated files are ready. Then another logic app moves them to their permanent location. This is because of the 20 item limit on the 'List files' action. I then created a logic app that finds the empty folders with the purpose of deleting them. I was trying to use the 'Delete file' action because I thought maybe it would work for folders as well but unfortunately, I keep getting a 'Bad Request' error . When I look at the output, it says that the error is because it is not a file.
Digging deeper, I found the developer site here and was looking at the Http requests and wondered how I would be able to use this in an Http call from within the logic app. I have a loop that delivers the path and id of the folders to be deleted. I am a novice to all of this and I am uncertain of how to properly format the input of the Http request.
The Method would be POST
The URI would be
https://api.dropboxapi.com/2/files/delete_v2
One header would be
"Content-Type: application/json"
I assume the Body would be the id or path of the folder I want to delete? In JSON like this of course
{\"path\": \"/Homework/math/quiz\"}"
Do I need to add authentication? If so, where would I get the token? My logic app already has been authorized to access Dropbox so is there a need for more authentication? There is a box to enter authentication of different kinds but not sure what values to use.