dropbox-php-sdk icon indicating copy to clipboard operation
dropbox-php-sdk copied to clipboard

how to make shared link password protected

Open baberzaman opened this issue 4 years ago • 1 comments

Here is the simple Shared Link with Public visibility. I want to make password protected shared link. Can anyone help how i can do that

(/**
* Assuming you have configured the DropboxApp class
* @see https://github.com/kunalvarma05/dropbox-php-sdk/wiki/Configuration
*/
$dropbox = new Dropbox($app);
$response = $dropbox->postToAPI("/sharing/create_shared_link_with_settings", ["path" => "/hello-world.txt", "settings" => ['requested_visibility' => 'public']]);

$data = $response->getDecodedBody();
var_dump($data))

baberzaman avatar Oct 08 '20 06:10 baberzaman

You can only use this feature on the premium membership of dropbox.

I've tested it on Laravel and it may be helpful to you.

$settings = [
    "path" => '/filepath',
    "settings" => [
        "expires" => 'yourdesiretime', //format => 'Y-m-d\TH:m:s\Z
        "access"  =>  [
            ".tag" => 'viewer'
        ],
        "link_password" => 'yourpassword',
        "requested_visibility" => [
            ".tag" => "password"
        ],
        "audience" => [
            ".tag" => "password"
        ]
    ]
];

gulgulia17 avatar May 11 '21 10:05 gulgulia17