cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need help managing photos with DropBox

Need help managing photos with DropBox

martinjuniqe
Explorer | Level 4
Go to solution

 

Hello Dropbox!
I am trying to set up an automated workflow via zapier for our company juniqe.com:

 

i need to invite new folder members as editors via their email, am am trying to do so via a webhook POST to the endpoint:

 

https://api.dropboxapi.com/2/sharing/add_folder_member

 

with the following data:

 

"{\"shared_folder_id\": \"{{folderid123456}}\",\"members\": [{\"member\": {\".tag\": \"email\",\"email\": \"{{memberemail123456}}\"},\"access_level\": \"editor\"}],\"quiet\": false,\"custom_message\": \"Here's your share folder!\"}"

 

this always returns: api.dropboxapi.com returned (400) Bad Request and said nothing

 

I can authenticate correctly and it recognizes the end point, i am sure the error is in the syntax somewhere 🙂

 

I'd really appreciate it if you could assist me and point me in the right direction - i am not a coder and am just taking a crack at something our product team hasn't had time for...

 

Have a good day, cheers from berlin!
Martin

16 Replies 16

martinjuniqe
Explorer | Level 4
Go to solution

Hi @Greg-DB and @chirstius

just wanted to follow up on this again, since i've still not gotten it to work. You were right, my app is 'user-linked' so the header Select-User has since been removed... 

 

I understand that you @chirstius set this up via the zapier web interface, but i am really not seeing where i went off script compared to you 

 
 

martinjuniqe
Explorer | Level 4
Go to solution

my error message still is cryptic and somewhat unspecific

The app returned "Invalid shared folder ID.". This usually happens because the information you were trying to update or use is already in use or being updated somewhere else. Please try again once it becomes available.

 

Please any help would really be appreciated here, the folder id is definitely valid and has just been created a few minutes ago, i am sure the issue is somewhere in the syntax only

 

 

Greg-DB
Dropbox Staff
Go to solution

@martinjuniqe That error should just indicate that the 'shared_folder_id' value you supplied in the API call isn't a valid shared folder ID.

Can you double check what's getting sent? Shared folder IDs are just integers, e.g., '12345678'; they are not the same as normal file/folder IDs (which look like 'id:A12bC3-d4E5f6').

You can get the shared folder ID from a number of places on the API, such as /2/files/list_folder[/continue] in FolderMetadata.sharing_info.shared_folder_id, or /2/sharing/list_folders[/continue] or /2/sharing/check_share_job_status in SharedFolderMetadata.shared_folder_id.

martinjuniqe
Explorer | Level 4
Go to solution

gotcha. please just dumb it down for me a nod - so i need to first run a get request to find out the shared folder id to call the webhook i'm trying to call. I have an earlier step in the automatization sharing said folder, but this does not return the shared folder id, but only a share link. 

the dropbox contains hundreds of folders, is there a simple way to get to the sharedfolderid of the folder by it's regular id or share link?

 

martinjuniqe
Explorer | Level 4
Go to solution

OK so i can could https://api.dropboxapi.com/2/sharing/share_folder as well and get a response including the shared folder id, this seems to work. 

but when trying to call the endpoint  https://api.dropboxapi.com/2/sharing/add_folder_member afterwards, i am receiving another error Screen Shot 2018-10-05 at 17.11.34.png

 

 

 

 

 

 

Greg-DB
Dropbox Staff
Go to solution

If you know the path or ID for the folder, and the folder is already a shared folder, you can get the shared folder ID by calling /2/files/get_metadata. The shared folder ID will be in the result at folder.sharing_info.shared_folder_id. Using /2/sharing/list_folders[/continue] on the folder's parent also works.

Note that creating a shared link for a folder does not make it a "shared folder". These actually refer to two different types of sharing on Dropbox: "shared links" and "shared folders". Folders will only receive shared folder IDs for the second type of sharing, "shared folders". 

It sounds like you may have used /2/sharing/create_shared_link_with_settings to make a shared link for the folder. To share the folder in order to get a shared folder ID, you should use /2/sharing/share_folder.

martinjuniqe
Explorer | Level 4
Go to solution

thanks, this now works - really appreciate your help!

i guess i did only create a shared link previously, and calling the share_folder endpoint really was what i needed to get to the right id, the next error was caused by something within Zapier i guess, i couldn't reproduce it after trying to run the whole process with an entirely fresh folder, sharing worked like a charm. 

 

thanks guys!

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    martinjuniqe Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?