Hi,
We are currently utilizing the Dropbox API to lock files within our team folder structure. For example, to lock the file located at:
/Soft launch/_2024-06-17_Dropbox-Tests/2024-06-17_Dropbox-Test Leerzeichen.indd
(full path: /Users/noel/Library/CloudStorage/Dropbox-Linkgroup/Soft launch/_2024-06-17_Dropbox-Tests/2024-06-17_Dropbox-Test Leerzeichen.indd)
We use the following curl command:
curl -X POST https://api.dropboxapi.com/2/files/lock_file_batch \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Dropbox-API-Select-User: YOUR_USER_ID" \
-H "Dropbox-API-Path-Root: {\".tag\": \"namespace_id\", \"namespace_id\": \"4662013585\"}" \
-d '{
"entries": [
{
"path": "/_2024-06-17_Dropbox-Tests/2024-06-17_Dropbox-Tests.indd"
}
]
}'
We identified the namespace ID for the "Soft launch" folder (4662013585) using the following command:
curl -X POST https://api.dropboxapi.com/2/team/team_folder/list \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
We aim to simplify this process by locking files without specifying the Dropbox-API-Path-Root header and namespace ID, ideally using the full path directly:
curl -X POST https://api.dropboxapi.com/2/files/lock_file_batch \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Dropbox-API-Select-User: YOUR_USER_ID" \
-d '{
"entries": [
{
"path": "/Soft launch/_2024-06-17_Dropbox-Tests/2024-06-17_Dropbox-Test Leerzeichen.indd"
}
]
}'
From the Dropbox API documentation, we understand that paths should be relative to the application's root, either an app folder or the root of a user's Dropbox, depending on the app's access type.
However, our attempts without the namespace ID have resulted in errors indicating that the path is not found. Is there a possible way other than creating “another” root folder?
Thanks!