I try to integrate a web app I'm working on with Dropbox Business API.
The case is uploading some of the documents to specified folders and then generating the sharing links for them, to serve them from Dropbox rather than store them on app server or generating them on the fly.
My flow is:
1. I prepare the file to be passed to Dropbox API.
2. I construct a specific filepath for this file, formatted as `ns:<namespace_id>/app_name/path/to/file.pdf`.
3. I upload the file to Dropbox, using the Dropbox-API-Select-Admin authentication (I gathered the admin member id earlier).
4. Then I want to create a shared link for this file, using the same authentication method and the same path I constructed earlier.
I'm stuck at the last point thoug, as I get the following error (along with status 409).
{
"error_summary": "path/not_found/.",
"error": {
".tag": "path",
"path": {
".tag":"not_found"
}
}
}I tried to use file ID, I fiddled with the API explorer... Nothing.
I use the following headers - Authorization (being the token), Content-Type (application/json), Dropbox-API-Select-Admin (providing the admin member_id).
Along the path in request body, I add the requested_visibility param and set it to team_only (though I determined that even skipping this, the request still fails).
I upload the file using basically the same headers (though Content-Type differs a little) plus Dropbox-API-Arg and Content-Length. The body of the request is a file.
The arguments I provide are:
{
path: ns:<namespace_id>/app_name/path/to/file.pdf,
mode: "add",
autorename: true,
mute: false
}The app status is Development. Permission type: Team member file access
I'm sure I missed something important. Maybe some app or team privileges that might seem not obvious?
Can anybody point me in the right direction?