We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

martinjuniqe's avatar
martinjuniqe
Explorer | Level 4
7 years ago

Need help managing photos with DropBox

 

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

  • Greg-DB's avatar
    Greg-DB
    7 years ago

    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.

  • 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's avatar
      martinjuniqe
      Explorer | Level 4

      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's avatar
        chirstius
        Icon for Dropbox Staff rankDropbox Staff

        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:

         

        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

         

         

         

         

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    Can you print the response body? It should contain a more useful error message. (The output here is just the status line.)

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

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!