Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

implement uploading of files #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kkuepper wants to merge 5 commits into notion-dotnet:main
base: main
Choose a base branch
Loading
from kkuepper:feature/support-files

Conversation

@kkuepper
Copy link
Contributor

@kkuepper kkuepper commented Sep 18, 2025
edited
Loading

Description

I need the functionality of uploading pictures and attaching them to pages. This PR implements:

  • uploading of files by adding RestClient.Upload()
  • attaching files to a page by adding file_upload
  • attaching images to ImageBlock

The integration test is a bit rough and probably needs to be refactored before it can be merged. If you give me some signals that the rest is fine and that there's a chance for it to be merged, I will take some time to cleanup the tests.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test_CanUploadAndSetProfilePicture (you need to change the path to the picture before you can run it yourself)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link
Contributor

@kkuepper The RestClient shouldn’t directly interact with the Notion API endpoint. Instead, we need to add a client for the FileUploads API endpoint. I’m not sure whether I missed something in the changelog or if the Notion team hasn’t documented it yet, but we need to add support for the File Uploads endpoint since it remains backward-compatible with the 2022 version.

Copy link
Contributor

@kkuepper I will working over this weekend to add support to it. You can refactor your PR once the Client is available or if you are okay I can add support for this.

kkuepper reacted with heart emoji

Copy link
Contributor Author

go ahead. If you make my PR obsolete by your changes, that's very fine by me. Feel free to use it for inspiration or copy & paste what you need.

KoditkarVedant reacted with thumbs up emoji

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /