One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
nive
2 years agoExplorer | Level 4
Not able to access the folders inside scoped app folder
There is a scoped app folder , and Im trying to access a zip file in a folder called "myfolder" in the Apps folder . In the script , I gave the dropbox path as /Apps/myfolder/download.zip , however while Im running the script it says :
Invoke-RestMethod : {"error_summary": "path/not_found/...", "error": {".tag": "path", "path": {".tag": "not_found"}}}
The app has read and write access . Why does this error occur . Also this app is created by another person and has been shared .
- ЗдравкоLegendary | Level 20
Hi nive,
Too few info has been provided for direct answer. First of all, what type of access your application has, "App folder" or "Full Dropbox"? You gave the path where you put the zip file, but what exactly you have passed to as argument? Provide something more complete as a example - what's executing (including all params), and the result. Mask confidential things like access tokens, everything else left as is.
Take in mind that if you have selected "App folder", application name is important too.
PS: If I have to bet, you made 2 mistakes. 1 - file placed on inaccessible for the application place, 2 - ignoring path change as result of path rooting for path in application folder. Of course, just a guess. Let's see...
- niveExplorer | Level 4
Hello @ Здравко ,
My teammate has created a "App folder" and the app name is "CISCAT" . The app has been shared and also access tokens are generated .
There is a folder inside /Apps called "CIS_CAT" that I need to access . This is the powershell code Im using to access the /Apps folder .
$dropboxToken = $response.access_token
$dropboxFilePath = "/Apps/CIS_CAT/CIS-CAT-Assessor-windows-GUI-jre-v4.30.0.zip"
$localDestination = "\\CIS-CAT\CIS-CAT-Assessor-windows-GUI-jre-v4.30.0.zip" # shared drive
# Construct the Dropbox API request URL
$apiUrl = "https://content.dropboxapi.com/2/files/download"
# Set the headers for the API request
$headers = @{
Authorization = "Bearer $dropboxToken"
"Dropbox-API-Arg" = '{"path":"' + $dropboxFilePath + '"}'
}
# Make the API request to download the file
Invoke-RestMethod -Uri $apiUrl -Headers $headers -OutFile $localDestinationI get the error as "path not found" . Should the Apps folder and its contents be shared too ?
- ЗдравкоLegendary | Level 20
Hi again nive,
You give different values for the path in Dropbox: In your first post "/Apps/myfolder/download.zip", but in second - "/Apps/CIS_CAT/CIS-CAT-Assessor-windows-GUI-jre-v4.30.0.zip"! This is important since you application name is "CISCAT", it can see only folder "/Apps/CIS_CAT/", as a root, and its content, but nothing outside. One note here: either application name missing one underbar or in the folder name is one more underbar! 🧐 I will suppose typing error. So, your application can never see a folder like "/Apps/myfolder/" or any of the folder content! Take this in mind. Here I'm not sure if my first bet above (inaccessible place) is correct; I will let you to decide.
Further since your application have access to "App folder" only, it appears to be the root of the accessible namespace! As a result you have to strip out from your path any leading part that contains the application folder itself - something you haven't done. Following this rule, the following line:
$dropboxFilePath = "/Apps/CIS_CAT/CIS-CAT-Assessor-windows-GUI-jre-v4.30.0.zip"
... should look something like:
$dropboxFilePath = "/CIS-CAT-Assessor-windows-GUI-jre-v4.30.0.zip"
i.e. stripped "/Apps/CIS_CAT" your application specific folder that appears as root from your application view point. You can think as this folder is automatically prepend to specified path. That's why with your code you're trying to download a file like "/Apps/CIS_CAT/Apps/CIS_CAT/CIS-CAT-Assessor-windows-GUI-jre-v4.30.0.zip", that of course doesn't exist. That's where the error comes from. 😀 The second bet confirmed true. 😉
Hope this helps.
Add: Take in mind that access tokens are short lived. For long term access, if you need such, consider refresh token usage.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,949 PostsLatest Activity: 10 minutes ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!