Restores a web link that has been moved to the trash.
An optional new parent ID can be provided to restore the web link to in case the original folder has been deleted.
12345
The ID of the web link.
id,type,name
A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
"Restored.docx"
An optional new name for the web link.
Specifies an optional ID of a folder to restore the web link to when the original folder no longer exists.
Please be aware that this ID will only be used if the original folder no longer exists. Use this ID to provide a fallback location to restore the web link to if the original location has been deleted.
"123"
The ID of parent item
Returns a web link object when it has been restored.
Returns an error if the user does not have access to the folder the web link is being restored to, or the user does not have permission to restore web link from the trash.
Returns an error if the web link is not in the trash.
Returns an error if there is an web link with the same name in the folder the web link is being restored to.
An unexpected client error.
curl -i -X POST "https://api.box.com/2.0/web_links/12345" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.trashedWebLinks.restoreWeblinkFromTrash(weblink.id);
client.trashed_web_links.restore_weblink_from_trash(weblink.id)
await client.TrashedWebLinks.RestoreWeblinkFromTrashAsync(webLinkId: weblink.Id);
web_link_to_restore = client.web_link(web_link_id='33333')
restored_web_link = client.trash().restore_item(web_link_to_restore)
print(f'Web link ID is {restored_web_link.id} and name is {restored_web_link.name}')
{
"id": "11446498",
"type": "web_link",
"created_at": "2012-12-12T10:53:43-08:00",
"created_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"description": "Example page",
"etag": "1",
"item_status": "trashed",
"modified_at": "2012-12-12T10:53:43-08:00",
"modified_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"name": "My Bookmark",
"owned_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"parent": {
"id": "12345",
"type": "folder",
"etag": "1",
"name": "Contracts",
"sequence_id": "3"
},
"path_collection": {
"entries": [
{
"id": "12345",
"etag": "1",
"type": "folder",
"sequence_id": "3",
"name": "Contracts"
}
],
"total_count": 1
},
"purged_at": "null",
"sequence_id": "3",
"shared_link": "null",
"trashed_at": "null",
"url": "https://www.example.com/example/1234"
}