Skip to content

feat: add canvases.getContent method - #1664

Merged
zimeg merged 1 commit into
mainfrom
clack/canvases-get-content
Oct 28, 2026
Merged

zimeg merged 1 commit into
mainfrom
clack/canvases-get-content

Conversation

@zimeg

@zimeg zimeg commented Oct 28, 2026

Copy link
Copy Markdown
Member

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

  • canvasesGetContent takes a required canvasId and an optional contentType of html or markdown (the API defaults to markdown), on both the sync and async clients.
  • CanvasesGetContentResponse adds content, the whole canvas as one string.
  • Adds the Tier 3 rate limit, a mock-server fixture, local tests, and a remote test that reads an edited canvas back in both formats.

Testing

  1. With a bot token that has the canvases:read scope, call slack.methods(token).canvasesGetContent(r -> r.canvasId("F0123456789")) on a canvas the app can read and confirm content comes back as markdown.
  2. Call it again with .contentType("html") and confirm content comes back as HTML.
  3. Optionally, run test_with_remote_apis.methods.canvases_Test with SLACK_SDK_TEST_BOT_TOKEN set. It hasn't been run against a live workspace yet.

Category (place an x in each of the [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

🤖 Generated with Claude Code

Adds the canvases.getContent Web API method to the sync and async
clients. The request takes canvas_id and an optional content_type of
html or markdown, and the response returns the canvas content.

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 project:slack-api-client project:slack-api-client java This is a label that @dependabot automatically creates. We don't use it. semver:minor 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 73.20%. Comparing base (b670e42) to head (f4191b4).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1664      +/-   ##
============================================
+ Coverage     72.98%   73.20%   +0.22%     
- Complexity     4630     4646      +16     
============================================
  Files           486      486              
  Lines         14632    14641       +9     
  Branches       1524     1524              
============================================
+ Hits          10679    10718      +39     
+ Misses         3049     3018      -31     
- Partials        904      905       +1     
Flag Coverage Δ
jdk-14 73.20% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@zimeg zimeg removed the java This is a label that @dependabot automatically creates. We don't use it. label Oct 28, 2026

@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 for reviewers that caught me off guard - TIL!

Comment on lines 1555 to 1566
CanvasesAccessSetResponse canvasesAccessSet(CanvasesAccessSetRequest req) throws IOException, SlackApiException;

CanvasesAccessSetResponse canvasesAccessSet(
RequestConfigurator<CanvasesAccessSetRequest.CanvasesAccessSetRequestBuilder> req)
throws IOException, SlackApiException;

CanvasesAccessDeleteResponse canvasesAccessDelete(CanvasesAccessDeleteRequest req)
throws IOException, SlackApiException;

CanvasesAccessDeleteResponse canvasesAccessDelete(
RequestConfigurator<CanvasesAccessDeleteRequest.CanvasesAccessDeleteRequestBuilder> req)
throws IOException, SlackApiException;

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 matches the import order above so leaving it as is!

@zimeg zimeg added this to the 1.52.1 milestone Oct 28, 2026
@zimeg
zimeg marked this pull request as ready for review October 28, 2026 16:49
@zimeg
zimeg requested a review from a team as a code owner October 28, 2026 16:49

@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.

✅ Thanks @zimeg! Love that the remote test covers markdown and HTML.

@zimeg

zimeg commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

@mwbrooks Thanks so much for the review! 🙏 ✨

@zimeg
zimeg merged commit 1921b22 into main Oct 28, 2026
7 checks passed
@zimeg
zimeg deleted the clack/canvases-get-content branch October 28, 2026 22:46
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 project:slack-api-client project:slack-api-client semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants