Caution
box-python-sdk-gen is deprecated and no longer maintained. As of September 17, 2025, it receives no new features, bug fixes, or security patches. Do not use it for new projects.
Use box-python-sdk v10+ instead: pip install "boxsdk>=10".
The equivalent of this page is box-python-sdk/docs/web_links.md. To migrate existing code, see the migration guide.
Creates a web link object within a folder.
This operation is performed by calling function create_web_link.
See the endpoint docs at API Reference.
client.web_links.create_web_link(
"https://www.box.com",
CreateWebLinkParent(id=parent.id),
name=get_uuid(),
description="Weblink description",
)- url
str- The URL that this web link links to. Must start with
"http://"or"https://".
- The URL that this web link links to. Must start with
- parent
CreateWebLinkParent- The parent folder to create the web link within.
- name
Optional[str]- Name of the web link. Defaults to the URL if not set.
- description
Optional[str]- Description of the web link.
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type WebLink.
Returns the newly created web link object.
Retrieve information about a web link.
This operation is performed by calling function get_web_link_by_id.
See the endpoint docs at API Reference.
client.web_links.get_web_link_by_id(weblink.id)- web_link_id
str- The ID of the web link. Example: "12345"
- boxapi
Optional[str]- The URL, and optional password, for the shared link of this item. This header can be used to access items that have not been explicitly shared with a user. Use the format
shared_link=[link]or if a password is required then useshared_link=[link]&shared_link_password=[password]. This header can be used on the file or folder shared, as well as on any files or folders nested within the item.
- The URL, and optional password, for the shared link of this item. This header can be used to access items that have not been explicitly shared with a user. Use the format
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type WebLink.
Returns the web link object.
Updates a web link object.
This operation is performed by calling function update_web_link_by_id.
See the endpoint docs at API Reference.
client.web_links.update_web_link_by_id(
weblink.id,
name=updated_name,
shared_link=UpdateWebLinkByIdSharedLink(
access=UpdateWebLinkByIdSharedLinkAccessField.OPEN, password=password
),
)- web_link_id
str- The ID of the web link. Example: "12345"
- url
Optional[str]- The new URL that the web link links to. Must start with
"http://"or"https://".
- The new URL that the web link links to. Must start with
- parent
Optional[UpdateWebLinkByIdParent] - name
Optional[str]- A new name for the web link. Defaults to the URL if not set.
- description
Optional[str]- A new description of the web link.
- shared_link
Optional[UpdateWebLinkByIdSharedLink]- The settings for the shared link to update.
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type WebLink.
Returns the updated web link object.
Deletes a web link.
This operation is performed by calling function delete_web_link_by_id.
See the endpoint docs at API Reference.
client.web_links.delete_web_link_by_id(web_link_id)- web_link_id
str- The ID of the web link. Example: "12345"
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type None.
An empty response will be returned when the web link was successfully deleted.