Removes a shared link from a file.
12345
The unique identifier that represents a file.
The ID for any file can be determined
by visiting a file in the web application
and copying the ID from the URL. For example,
for the URL https://*.app.box.com/files/123
the file_id
is 123
.
shared_link
Explicitly request the shared_link
fields
to be returned for this item.
Returns a basic representation of a file, with the shared link removed.
Returned when the access token provided in the Authorization
header
is not recognized or not provided.
Returned if the user does not have all the permissions to complete the update.
Returned if the file is not found, or the user does not have access to the file.
Returned if the file_id
is not in a recognized format.
Returns an error when the If-Match
header does not match
the current etag
value of the file. This indicates that the file
has changed since it was last requested.
An unexpected client error.
curl -i -X PUT "https://api.box.com/2.0/files/32423234?fields=shared_link" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"shared_link": null
}'
BoxFile file = new BoxFile(api, "12345");
BoxFile.Info info = file.getInfo();
info.removeSharedLink();
file.updateInfo(info);
file_id = '11111'
client.file(file_id).remove_shared_link()
client.files.update('12345', {
shared_link: null
}).then(file => {
// ...
})
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")
}
{
"etag": "1",
"id": "12345",
"shared_link": null,
"type": "file"
}