cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

16 Replies 16

Greg-DB
Dropbox Staff
Go to solution
Can you print the response body? It should contain a more useful error message. (The output here is just the status line.)

chirstius
Dropbox Staff
Go to solution

Hello @martinjuniqe,

 

Can you confirm if you are setting this up via the Zapier web interface or doing it programmatically?

 

I was able to test via the web UI and this endpoint can definitely be called from a webhook. If you are configuring it from the web UI I can walk you through how I setup a test request to hit the endpoint. If it's a programmatic call it would be useful to see the code you are using around this call to help identify any issues.

 

Thanks,

 

-Chuck

martinjuniqe
Explorer | Level 4
Go to solution

Hey Chuck @chirstius
Yes, it's being done via the web interface, not programmatically. 

Could you maybe sshare the code that you used to test? Like i said, i am not a coder (my job here actually is art curator, don't ask my why i am doing what i am doing lol), so any copy&pastable examples would be great, i am sure i am just messing up the syntax. 


Thanks a ton! 

 

 

chirstius
Dropbox Staff
Go to solution

@martinjuniqe,

 

Sorry for the delayed response, here are the steps I took:

 

First, configure whatever trigger you plan to use for the zap.

 

Next, when you configure an action, select "webhook" and choose "Custom Request" and configure it as follows:

zapier_webhook.JPG

 

NOTE - This assumes you are using a Team-linked access token with the member file access permission. If you are using a user-linked access token you can remove the 'Dropbox-API-Select-User' header. If you don't know how to get the <owner_memebr_id> placeholder value you can use the endpoint:

https://www.dropbox.com/developers/documentation/http/teams#team-members-get_info

 

Which can quickly be accessed from the API Explorer here:

https://dropbox.github.io/dropbox-api-v2-explorer/team/#team_members/get_info

 

Use the email of an account that has permission to add members to the folder and from the results get their team_member_id which will look like 'dbmid:abcdef12345' and use that for the 'Dropbox-API-Select-User' header value.

 

Fill in all other placeholder values as appropriate from previous Zapier steps/data and hopefully this will get you moving in the right direction.

 

-Chuck

 

 

 

 

martinjuniqe
Explorer | Level 4
Go to solution

Hey Chuck!
I am trying to follow your example but am receiving the following error code

 

We had trouble sending your test through. Please try again. Error: 
api.dropboxapi.com returned (400) Bad Request and said "Error in call to API function "sharing/add_folder_member": Unexpected select user header. Your app does not have permission to use this feature

 

i am pasting my request below, is this something to do with the user i am authenticating as?

 

 

Screen Shot 2018-06-01 at 17.11.41.png

Greg-DB
Dropbox Staff
Go to solution
It sounds like you're not using a "team-linked" app (i.e., an app registered for the "Dropbox Business API"). The Dropbox-API-Select-User header is only meant for team-linked apps. Since you're using a "user-linked" app (i.e., an app registered for the "Dropbox API"), you should remove the Dropbox-API-Select-User header.

martinjuniqe
Explorer | Level 4
Go to solution

Hi Greg, I tried your suggestion and removed the header, now resulting in the following error again: 

api.dropboxapi.com returned (400) Bad Request and said nothing

 

Is there a way to find out if we're using a team or user linked account? 

 

It seems like I am hitting a wall with this, and it (seems) to be so dirt simple!

Your help is  really appreciated. I just think i might need a little more of it! 

 

martinjuniqe
Explorer | Level 4
Go to solution
Hi Greg, I tried your suggestion and removed the header, now resulting in the following error again: 

api.dropboxapi.com returned (400) Bad Request and said nothing

 

Is there a way to find out if we're using a team or user linked account? 

 

It seems like I am hitting a wall with this, and it (seems) to be so dirt simple!

Your help is  really appreciated. I just think i might need a little more of it! 

 

Greg-DB
Dropbox Staff
Go to solution

@martinjuniqe Is that the actual/full output you get? There should be more useful information in the response body for that 400 error (not "nothing").

 

You can check your app type(s) on the App Console. Any apps with the "Full Dropbox" or "App folder" permissions are "user-linked". Any apps with a "Team" permission are "team-linked".

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?