Skip to content

Conversation

@kkuepper
Copy link
Contributor

@kkuepper kkuepper commented Sep 18, 2025

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

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

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

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