Forum Discussion

m1lle's avatar
m1lle
Explorer | Level 4
8 years ago
Solved

API to set_password for shared folder?

Using create_shared_link_with_settings I am able to share a folder and set a password for it. But I don't seam to find any way to *change* this password?

 

How do I do that through the API? Is it possible?

 

I found update_folder_policy for this, but it's not usable for an "App Folder" app. (I'm getting the error: Your API app is an "App Folder" app. It is not allowed to access this API function)

  • To set a password, you need to set the 'requested_visibility' to 'password'. So, in your example, that would look like:

     

     

    --data '{"url":"https://www.dropbox.com/sh/rjg3ms4tkca69XX/AABQP1tMaxHjUey4b8mQlg9XX?dl=0","settings":{"link_password":"zzz","requested_visibility":{".tag":"password"}}}'
    

     

     

9 Replies

Replies have been turned off for this discussion
  • m1lle's avatar
    m1lle
    Explorer | Level 4
    8 years ago

    Sounded really promising! Thank you for pointing me in the right direction.

     

    Unfortunley I'm getting an error using that command:

     

    {"error_summary": "settings_error/invalid_settings/..", "error": {".tag": "settings_error", "settings_error": {".tag": "invalid_settings"}}}

     

    Using the CURL command with this data:

    --data '{"url":"https://www.dropbox.com/sh/rjg3ms4tkca69XX/AABQP1tMaxHjUey4b8mQlg9XX?dl=0","settings":{"link_password":"zzz"}}'

     

    All settings for this command are optional according to the documentation, but I'm still getting invalid_settings?

    (Perhaps it has to to something with the URL parameter?) 

     

    Suggestions on what could be wrong?

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    To set a password, you need to set the 'requested_visibility' to 'password'. So, in your example, that would look like:

     

     

    --data '{"url":"https://www.dropbox.com/sh/rjg3ms4tkca69XX/AABQP1tMaxHjUey4b8mQlg9XX?dl=0","settings":{"link_password":"zzz","requested_visibility":{".tag":"password"}}}'
    

     

     

  • m1lle's avatar
    m1lle
    Explorer | Level 4
    8 years ago
    Ahhh, "optional", but not so optional. Thanks a thousand, Greg!
  • tyni02's avatar
    tyni02
    New member | Level 2
    8 years ago

    porfavor mandenme el correo para repuperar la cuenta porfavor se lo suplico

  • xsmael's avatar
    xsmael
    New member | Level 2
    6 years ago

    What if i dont want to set a password ?

  • xsmael's avatar
    xsmael
    New member | Level 2
    6 years ago

    Greg-DB  a écrit :

    To set a password, you need to set the 'requested_visibility' to 'password'. So, in your example, that would look like:

     

     

    --data '{"url":"https://www.dropbox.com/sh/rjg3ms4tkca69XX/AABQP1tMaxHjUey4b8mQlg9XX?dl=0","settings":{"link_password":"zzz","requested_visibility":{".tag":"password"}}}'

     


    What if i dont want to set a password ?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    xsmael If you want to create a shared link without a password, you would still use /2/sharing/create_shared_link_with_settings , but you would omit the 'link_password' parameter (and use 'requested_visibility' accordingly, i.e., either omit it it set it to something other than "password"). 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!