Skip to content

Conversation

@RajaPremSai
Copy link

Fix deprecated file upload methods with modern Slack API

Problem

The UploadFile() and UploadFileV2() methods are broken due to deprecated Slack API endpoints and parameter validation issues:

  • UploadFile() returns method_deprecated errors
  • UploadFileV2() has type mismatches and parameter issues
  • Both methods use the deprecated files.upload endpoint

Solution

  • Add FixedUploadFile() and FixedUploadFileV2() methods using modern 3-step upload process
  • Use files.getUploadURLExternal → direct upload → files.completeUploadExternal
  • Fix parameter validation and type issues
  • Add deprecation warnings pointing to new methods
  • Maintain backward compatibility

Files Changed

  • files_v2_fixed.go - New fixed methods
  • files_v2_fixed_test.go - Tests for new methods
  • examples/file_upload_fix_example.go - Working examples
  • files.go - Deprecation warnings

Testing

All tests pass. The new methods work with the current Slack API.

Migration

Users can replace:

  • api.UploadFile(params)api.FixedUploadFile(params)
  • api.UploadFileV2(params)api.FixedUploadFileV2(params)

The old methods remain available with deprecation warnings.

@RajaPremSai
Copy link
Author

Hi maintainers! 👋

I've successfully updated this branch with the latest changes from master. This PR is ready for review and addresses important issues with deprecated file upload methods in the Slack API.

Actions completed:
✅ Updated branch with base branch (master) - resolved conflicts cleanly
✅ Branch is now current and ready for review

Pending items that require maintainer action:
🔍 Pull request review and approval - At least 1 approving review from a maintainer is required
Workflow approval - The lint workflow is waiting for maintainer approval to run

This PR fixes critical functionality by replacing deprecated files.upload endpoints with the modern 3-step upload process, maintaining backward compatibility while providing working alternatives.

Thanks for your time reviewing this contribution! 🙏

@RajaPremSai
Copy link
Author

Hi maintainers! 👋

I've successfully updated this branch with the latest changes from master. This PR is ready for review and addresses important issues with deprecated file upload methods in the Slack API.

Actions completed:
✅ Updated branch with base branch (master) - resolved conflicts cleanly
✅ Branch is now current and ready for review

Pending items that require maintainer action:
🔍 Pull request review and approval - At least 1 approving review from a maintainer is required
⚡ Workflow approval - The lint workflow is waiting for maintainer approval to run

This PR fixes critical functionality by replacing deprecated files.upload endpoints with the modern 3-step upload process, maintaining backward compatibility while providing working alternatives.

Thanks for your time reviewing this contribution! 🙏

@nlopes
Copy link
Collaborator

nlopes commented Dec 30, 2025

I know you're well intentioned here but this isn't a PR I'm inclined to review with current state.

It has a bunch of changes I don't like, namely:

  • adds files_fixed.go - this is unnecessary imo. If we're fixing something in files.go then let's do it in files.go
  • "fixed" / "Fixed" in general is not very good nomenclature
  • it changed comment sections in files.go to remove information that was useful

Basically, if there are methods that are broken, let's fix them rather than add new ones.

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