Remove Shared Link
Remove Shared Link
A shared link may be removed from a resource by calling the
update file or
update folder or
update weblink endpoint and setting the
shared_link
value to null
.
Remove Shared Link on File
To remove a shared link on a file, specify the ID of file to set the
shared_link
field to null
.
cURL
curl -i -X PUT "https://api.box.com/2.0/files/32423234?fields=shared_link" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"shared_link": null
}'
Java
BoxFile file = new BoxFile(api, "12345");
BoxFile.Info info = file.getInfo();
info.removeSharedLink();
file.updateInfo(info);
Python
file_id = '11111'
client.file(file_id).remove_shared_link()
Node
client.files.update('12345', {
shared_link: null
}).then(file => {
// ...
})
iOS
client.files.deleteSharedLink(fileId: "11111") { (result: Result<Void, BoxSDKError>) in
guard case .success = result else {
print("Error removing file shared link")
return
}
print("File shared link removed")
}
Remove Shared Link on Folder
To remove a shared link on a folder, specify the ID of folder to set the
shared_link
field to null
.
cURL
curl -i -X PUT "https://api.box.com/2.0/folders/32423234?fields=shared_link" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"shared_link": null
}'
Java
BoxFolder folder = new BoxFolder(api, "12345");
BoxFolder.Info info = folder.getInfo();
info.removeSharedLink();
folder.updateInfo(info);
Python
folder_id = '11111'
client.folder(folder_id).remove_shared_link()
Node
client.folders.update('12345', {
shared_link: null
}).then(folder => {
// ...
})
iOS
client.folders.deleteSharedLink(forFolder: "11111") { (result: Result<Void, BoxSDKError>) in
guard case .success = result else {
print("Error removing folder shared link")
return
}
print("Folder shared link removed")
}
Remove Shared Link on Web Link
To remove a shared link on a web link, specify the ID of web link to set the
shared_link
field to null
.
cURL
curl -i -X PUT "https://api.box.com/2.0/web_links/32423234?fields=shared_link" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"shared_link": null
}'
Python
client.web_link('12345').remove_shared_link()
.NET
BoxWebLink updatedLink = client.WebLinksManager.DeleteSharedLinkAsync("11111");
iOS
client.webLinks.deleteSharedLink(forWebLink: "11111") { (result: Result<Void, BoxSDKError>) in
guard case .success = result else {
print("Error removing weblink shared link")
return
}
print("WebLink shared link removed")
}