Skip to content

feat: add canvases.getContent method - #1999

Merged
zimeg merged 2 commits into
mainfrom
clack/canvases-get-content
Oct 28, 2026
Merged

zimeg merged 2 commits into
mainfrom
clack/canvases-get-content

Conversation

@zimeg

@zimeg zimeg commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds the canvases.getContent method to the Web API clients.

  • canvases_getContent(canvas_id=..., content_type=...) takes a required canvas_id and an optional content_type of "html" or "markdown" (the API defaults to markdown).
  • The async and legacy clients are regenerated with scripts/codegen.py.
  • The method is added to the Web API coverage test.

Testing

  1. With a token that has the canvases:read scope, call client.canvases_getContent(canvas_id="F0123456789") on a canvas you can read and confirm content comes back as markdown.
  2. Call it again with content_type="html" and confirm content comes back as HTML.
  3. Repeat step 1 with AsyncWebClient to check the generated async method.

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

🤖 Generated with Claude Code

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor web-client labels Oct 28, 2026
@zimeg zimeg self-assigned this Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.37%. Comparing base (c7adb46) to head (0a3f876).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1999      +/-   ##
==========================================
+ Coverage   84.36%   84.37%   +0.01%     
==========================================
  Files         118      118              
  Lines       13800    13809       +9     
==========================================
+ Hits        11643    11652       +9     
  Misses       2157     2157              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🐍 A note after testing with examples!

Comment thread slack_sdk/web/client.py
Comment on lines 2872 to 2883
def canvases_delete(
self,
*,
canvas_id: str,
**kwargs,
) -> SlackResponse:
"""Deletes a canvas.

https://docs.slack.dev/reference/methods/canvases.delete
"""
kwargs.update({"canvas_id": canvas_id})
return self.api_call("canvases.delete", params=kwargs)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🧮 note: This follows the implementation of "edit" which makes the following seem out of order but we don't address that in this PR.

@zimeg zimeg added this to the 3.next milestone Oct 28, 2026
@zimeg
zimeg marked this pull request as ready for review October 28, 2026 17:08
@zimeg
zimeg requested a review from a team as a code owner October 28, 2026 17:08

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ Appreciate this one @zimeg!

@zimeg

zimeg commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

@mwbrooks Thanks so much for the review! 🙏 ✨

@zimeg
zimeg merged commit 7c42ea5 into main Oct 28, 2026
19 checks passed
@zimeg
zimeg deleted the clack/canvases-get-content branch October 28, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants