Manage Applications

    Restore web link

    post
    https://api.box.com/2.0
    /web_links/:web_link_id

    Restores an web link that has been moved to the trash.

    Request

    application/json

    Path Parameters

    Query Parameters

    string arrayin queryoptional
    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.

    Request Body

    stringin bodyoptional
    Restored.docx

    An optional new name for the web link.

    Parentin body

    The optional parent folder that the web link will be restored to.

    Use this if the original parent folder no longer exists, or the user no longer has access to the original parent folder.

    stringin bodyoptional
    123

    The ID of parent item

    Response

    application/jsonWeb Link

    Returns a web link object when it has been restored.

    application/jsonClient Error

    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.

    application/jsonClient Error

    Returns an error if the web link is not in the trash.

    application/jsonClient Error

    Returns an error if there is an web link with the same name in the folder the web link is being restored to.

    You can now try out some of our APIs live, right here in the documentation.
    Log In

    Request Example

    cURL
    curl -X POST https://api.box.com/2.0/web_links/12345 \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json"
    Python
    web_link_to_restore = client.web_link(web_link_id='33333')
    restored_web_link = client.trash().restore_item(web_link_to_restore)
    print('Web link ID is {0} and name is {1}'.format(restored_web_link.id, restored_web_link.name))

    Response Example

    {
      "id": 11446498,
      "type": "web_link",
      "sequence_id": 3,
      "etag": 1,
      "name": "My Bookmark",
      "url": "https://www.example.com/example/1234",
      "parent": {
        "id": 12345,
        "etag": 1,
        "type": "folder",
        "sequence_id": 3,
        "name": "Contracts"
      },
      "description": "Example page",
      "path_collection": [
        {
          "id": 12345,
          "etag": 1,
          "type": "folder",
          "sequence_id": 3,
          "name": "Contracts"
        }
      ],
      "created_at": "2012-12-12T10:53:43-08:00",
      "modified_at": "2012-12-12T10:53:43-08:00",
      "trashed_at": "2012-12-12T10:53:43-08:00",
      "purged_at": "2012-12-12T10:53:43-08:00",
      "created_by": {
        "id": 11446498,
        "type": "user",
        "name": "Aaron Levie",
        "login": "ceo@example.com"
      },
      "modified_by": {
        "id": 11446498,
        "type": "user",
        "name": "Aaron Levie",
        "login": "ceo@example.com"
      },
      "owned_by": {
        "id": 11446498,
        "type": "user",
        "name": "Aaron Levie",
        "login": "ceo@example.com"
      },
      "shared_link": {
        "url": "https://www.box.com/s/vspke7y05sb214wjokpk",
        "download_url": "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg",
        "vanity_url": "https://acme.app.box.com/v/my_url/",
        "access": "open",
        "effective_access": "company",
        "effective_permission": "can_download",
        "unshared_at": "2018-04-13T13:53:23-07:00",
        "is_password_enabled": true,
        "permissions": {
          "can_download": true,
          "can_preview": true
        },
        "download_count": 3,
        "preview_count": 3
      },
      "item_status": "active"
    }