Feat(ER-00677/ER-00863/ER-00864): Replace deprecated Smartsheet sharing, workspace, and folder APIs#2
Open
gaurav-softwarex wants to merge 4 commits into
Open
Conversation
added 4 commits
June 21, 2026 20:30
… sharing methods Adds SmartoolsSharing operations class implementing the new unified /shares endpoint (ER-00677). Also adds backward-compatible wrappers on SmartoolsSheets, SmartoolsWorkspaces, SmartoolsReports, and new SmartoolsSights so existing call sites (ER-00863) work without changes. - smartools/operations/sharing.py: SmartoolsSharing with list_asset_shares, share_asset, update_asset_share, delete_asset_share, get_asset_share - smartools/models/asset_share_paginated_result.py: Result model exposing .items (new API) and .data (backward-compat alias) - smartools/operations/sheets.py: list_shares, share_sheet, update_share, delete_share routed through Sharing.* - smartools/operations/workspaces.py: list_shares, share_workspace, update_share, delete_share routed through Sharing.* - smartools/operations/reports.py: list_shares, update_share, delete_share routed through Sharing.* - smartools/operations/sights.py: SmartoolsSights (new) with list_shares, share_sight, update_share, delete_share routed through Sharing.*
The new unified Smartsheet /shares endpoint returns shares under the "items" key (not "data") and serialises userId/groupId as strings instead of integers. - Add SmartoolsShare model that converts string user/group IDs to int before passing them to the base SDK's Number validator - Explicitly patch smartsheet.models.Share with SmartoolsShare so the Result model's dynamic class lookup also picks it up - Fix SmartoolsAssetSharesPaginatedResult to read "items" key first, with "data" as fallback for old-API compatibility
Overrides Workspaces.get_workspace to never send the deprecated loadAll=true query parameter. When load_all=True is requested, nested folder contents are fetched recursively via individual Folders.get_folder calls, producing the same workspace tree as before. Project code calling get_workspace(workspace_id, load_all=True) continues to work without any changes.
…points
- Replace GET /workspaces/{id} (deprecated) with /metadata + /children endpoints
in SmartoolsWorkspaces.get_workspace; supports load_all for nested folders
- Replace GET /folders/{id} (deprecated) with /metadata + /children endpoints
in SmartoolsFolders.get_folder
- Replace GET /workspaces/{id}/folders and GET /folders/{id}/folders (deprecated)
with /children endpoint in SmartoolsWorkspaces.list_folders and
SmartoolsFolders.list_folders, using token-based pagination
- Replace deprecated includeAll param in Workspaces.list_workspaces with
automatic page iteration
- Add SmartoolsContainerChildren model to parse paginated /children responses;
stores raw dicts so TypedList on Workspace/Folder uses monkey-patched model classes
- Add backward-compat wrappers: Sheets.get_share, Reports.share_report/list_shares/
update_share/delete_share delegating to the unified sharing API
davocarli
requested changes
Jul 2, 2026
davocarli
left a comment
Owner
There was a problem hiding this comment.
I received the exception below when testing on a clean install. I believe the "Share" model was replaced with "AssetShare" in the latest version(s) of the smartsheet-python-sdk. Could you update the dependencies of smartools to require the latest version of the python sdk and also address this issue?
Repro Steps
- Install uv
- In a directory of your choosing, run
uv init --script smartools_testing.py - run
uv add --script smartools_testing.py git+https://github.com/davocarli/smartools.git@feature/ER-00677-sharing-api - run
echo "\nimport smartools" >> smartools_testing.py - run
uv run smartools_testing.py
Traceback (most recent call last):
File "/Users/davocarli/dev/sublime_env/smartools_testing.py", line 19, in <module>
import smartools
File "/Users/davocarli/.cache/uv/environments-v2/smartools-testing-2f633ca73b9d2625/lib/python3.14/site-packages/smartools/__init__.py", line 11, in <module>
from . import models
File "/Users/davocarli/.cache/uv/environments-v2/smartools-testing-2f633ca73b9d2625/lib/python3.14/site-packages/smartools/models/__init__.py", line 11, in <module>
from .asset_share_paginated_result import SmartoolsAssetSharesPaginatedResult
File "/Users/davocarli/.cache/uv/environments-v2/smartools-testing-2f633ca73b9d2625/lib/python3.14/site-packages/smartools/models/asset_share_paginated_result.py", line 1, in <module>
from .share import SmartoolsShare
File "/Users/davocarli/.cache/uv/environments-v2/smartools-testing-2f633ca73b9d2625/lib/python3.14/site-packages/smartools/models/share.py", line 1, in <module>
from smartsheet.models import Share
ImportError: cannot import name 'Share' from 'smartsheet.models' (/Users/davocarli/.cache/uv/environments-v2/smartools-testing-2f633ca73b9d2625/lib/python3.14/site-packages/smartsheet/models/__init__.py)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces all Smartsheet APIs deprecated/sunset as of Jun-15-2026 with their
new equivalents. All changes are in the smartools library — no changes required
in consuming codebases. Old method signatures are preserved for backward
compatibility.
ER-00677 / ER-00863 — Unified Sharing API
POST/GET/PATCH/DELETE /sharesAPI (withassetType+assetIdparams)SmartoolsSharingclass for direct unified API accessSheets,Workspaces,Reports,Sightsso existing callers (
share_sheet,list_shares,update_share, etc.) workwithout any code changes
SmartoolsSharemodel to handle stringuserId/groupIdreturned bynew API (old API returned integers)
SmartoolsAssetSharesPaginatedResultmodel for new paginated share responsesER-00864 — Workspace & Folder Endpoints
GET /workspaces/{id}with/metadata+/childrenGET /folders/{id}with/metadata+/childrenGET /workspaces/{id}/foldersandGET /folders/{id}/folderswith
/childrenendpoint, using token-based paginationincludeAllparam inlist_workspaceswith automaticpage iteration
SmartoolsContainerChildrenmodel to parse paginated/childrenresponsesType of Change
Checklist
ER-XXXXXX)