dropbox-php-sdk
dropbox-php-sdk copied to clipboard
how to make shared link password protected
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))
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"
]
]
];