I've created an app with a dedicated account that our administrator set up for me. The app works great. I've set up Salesforce to connect to the app using an Auth. Provider and Named Credentials. None of this has my name on it.
The admin created a Team Folder that I want to be able to create sub folders under and then file requests for those sub folders. Whenever I create the sub folders, they were getting created under my account, not the system account and not the Team Folder.
At first I was just using the /create/folder_v2 endpoint, but after going through a bunch of articles on it, I realized I probably needed to use the /sharing/share_folder endpoint. It still wasn't working quite right.
Finally, I found this resource: https://developers.dropbox.com/dbx-team-files-guide Which suggested that I set the Dropbox-API-Path-Root in the header of the callout. So I got the root id from the api explorer from my service account and tried to use it, but I'm getting errors. And the errors HAVE MY NAME in it. Somehow it still is trying to create the folders under my named account instead of the account that was created by the app.
Error creating folder: {"error":{".tag":"invalid_root","invalid_root":{".tag":"team","home_namespace_id":"xxxxxxxx","home_path":"/Barry ...","root_namespace_id":"xxxxxxxx"}},"error_summary":"invalid_root/"}
Skipped file request due to folder creation error.