Skip to content

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
masterfrom
feature/ER-00677-sharing-api
Open

Feat(ER-00677/ER-00863/ER-00864): Replace deprecated Smartsheet sharing, workspace, and folder APIs#2
gaurav-softwarex wants to merge 4 commits into
masterfrom
feature/ER-00677-sharing-api

Conversation

@gaurav-softwarex

Copy link
Copy Markdown
Collaborator

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

  • Replaced all deprecated per-asset sharing endpoints with the new unified
    POST/GET/PATCH/DELETE /shares API (with assetType + assetId params)
  • Added SmartoolsSharing class for direct unified API access
  • Added backward-compat wrappers on Sheets, Workspaces, Reports, Sights
    so existing callers (share_sheet, list_shares, update_share, etc.) work
    without any code changes
  • Added SmartoolsShare model to handle string userId/groupId returned by
    new API (old API returned integers)
  • Added SmartoolsAssetSharesPaginatedResult model for new paginated share responses

ER-00864 — Workspace & Folder Endpoints

  • Replaced deprecated GET /workspaces/{id} with /metadata + /children
  • Replaced deprecated GET /folders/{id} with /metadata + /children
  • Replaced deprecated GET /workspaces/{id}/folders and GET /folders/{id}/folders
    with /children endpoint, using token-based pagination
  • Replaced deprecated includeAll param in list_workspaces with automatic
    page iteration
  • Added SmartoolsContainerChildren model to parse paginated /children responses

Type of Change

  • Feature — new functionality
  • Bugfix — fixes an existing issue
  • Hotfix — urgent fix
  • Refactor — code restructuring, no behavior change
  • Docs — documentation updates
  • Chore — CI, dependencies, tooling, etc.

Checklist

  • Manual testing performed
  • My branch follows the naming convention (ER-XXXXXX)
  • I have run pre-commit checks locally
  • I have added/updated tests as appropriate
  • I have updated documentation as needed
  • My changes do not introduce new warnings or errors

Gaurav Shimpi 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
@gaurav-softwarex gaurav-softwarex self-assigned this Jun 22, 2026

@davocarli davocarli left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants