Skip to content

Releases: slackapi/java-slack-sdk

version 1.29.1

07 Apr 01:55
Compare
Choose a tag to compare

version 1.29.0

04 Apr 06:24
Compare
Choose a tag to compare

Changes

  • #1134 Add MethodsCustomRateLimitResolver to enable developers to override the rate limiter's behavior - Thanks @seratch
  • #1135 Upgrade dependency patch/minor versions (kotlin, http4k, micronaut) - Thanks @seratch

version 1.28.1

27 Mar 06:58
Compare
Choose a tag to compare

Changes


version 1.28.0

08 Mar 07:00
Compare
Choose a tag to compare

Changes

  • [all] #1119 Upgrade Lombok/Kotlin patch versions (and optional others too) - Thanks @seratch
  • [bolt] #1126 Add thread_ts parameter to response_url sender inputs - Thanks @seratch
  • [slack-api-client] #1117 Fix #1082 Add admin.roles.{list|add|remove}Assignments API supports - Thanks @seratch
  • [slack-api-client] #1123 Fix #1122 A request toward an invalid webhook URL get 200 OK response (expected: 302 redirection) - Thanks @tsasaki609 @seratch
  • [docs] #1116 #1118 Fix document errors - Thanks @JonGilmore

version 1.27.3

11 Jan 04:47
Compare
Choose a tag to compare

Changes

  • [slack-api-client] #1106 Fix #821 emoji.list missing include_categories option - Thanks @slushpupie @seratch
  • [all] #1107 Upgrade gson, kotlin, and so on - Thanks @seratch
  • [slack-api-model] Add media_progress property in file objects - Thanks @seratch
  • [slack-api-client] Add team_id to admin.analytics.getFile API response data - Thanks @seratch

version 1.27.2

30 Nov 05:53
Compare
Choose a tag to compare

Changes

  • [slack-api-client] #1089 Fix #1088 Update MethodsClient to be consistent on the text field warnings with Node / Python SDKs - Thanks @seratch
  • [slack-api-client] #1090 Fix #1087 Add admin.conversations.bulk{Archive|Delete|Move} API method support - Thanks @seratch
  • [bolt] #1097 Fix #1092 by reducing info level logging in AmazonS3InstallationService/AmazonS3OAuthStateService - Thanks @seratch
  • [document] #1096 Update Spring Boot documents and examples to support v3 - Thanks @seratch

version 1.27.1

17 Nov 01:04
Compare
Choose a tag to compare

Changes


version 1.27.0

08 Nov 23:41
Compare
Choose a tag to compare

Changes

  • [slack-api-model] #1076 Add datetimepicker, url, email, number block elements - Thanks @seratch
  • [slack-api-client] #1081 Add requestFileInfo param to MethodsClient#filesUploadV2 method - Thanks @seratch
  • [all] #1077 Upgrade GSON and other optional dependencies - Thanks @seratch
  • [project] #1079 Removed deprecated CodCov script - Thanks @WilliamBergamin
  • [documents] #1073 Resolve minor typos for ExecutorService - Thanks @jasonoh

version 1.26.1

06 Oct 02:32
Compare
Choose a tag to compare

Changes

  • [slack-api-client] #1068 Fix context.teamId for view interactions in a Slack Connect channel - Thanks @seratch

version 1.26.0

05 Oct 03:34
Compare
Choose a tag to compare

Announcements

files.upload v2

We've received many reports on the performance issue of the existing files.upload API. So, to cope with the problem, our platform team decided to unlock a new way to upload files to Slack via public APIs. To utilize the new approach, developers need to implement the following steps on their code side:

  1. Call MethodsClient#filesGetUploadURLExternal() method to receive a URL to use for each file
  2. Perform an HTTP POST request to the URL you received in step 1 for each file
  3. Call MethodsClient#filesCompleteUploadExternal() method with the pairs of file ID and title to complete the whole process, plus share the files in a channel
  4. If you need the full metadata of the files, call MethodsClient#filesInfo() method for each file

We do understand that writing the above code requires many lines of code. Also, the existing MethodsClient#filesUpload() users have to take a certain amount of time for migration. To mitigate the pain, we've added a wrapper method named MethodsClient#filesUploadV2() on the SDK side.

Also, in addition to the performance improvements, another good news is that 3rd party apps can now upload multiple files at a time!

See the following code examples demonstrating how the wrapper method works:

import com.slack.api.Slack;
import com.slack.api.methods.request.files.FilesUploadV2Request;
import com.slack.api.methods.response.files.FilesUploadResponse;
import com.slack.api.methods.response.files.FilesUploadV2Response;

import java.util.Arrays;
import java.util.List;

Slack slack = Slack.getInstance();
String token = System.getenv("SLACK_BOT_TOKEN");

// Legacy files.upload code example
FilesUploadResponse legacyResponse = slack.methods(token).filesUpload(r -> r
  .file(new java.io.File("./logo.png"))
  .filename("logo.png")
  .title("Company Logo")
  .channels(Arrays.asList("C123456"))
  .initialComment("Here is the latest version of our company logo!")
);
com.slack.api.model.File legacyFile = legacyResponse.getFile();

// V2 wrapper is mostly the same!
FilesUploadV2Response v2Response = slack.methods(token).filesUploadV2(r -> r
  .file(new java.io.File("./logo.png"))
  .filename("logo.png")
  .title("Company Logo")
  .channel("C123456") // sharing a file in multiple channels is no longer supported
  .initialComment("Here is the latest version of our company logo!")
);
com.slack.api.model.File v2File = v2Response.getFile();

// Now you can upload multiple files at a time!
FilesUploadV2Response v2MultiFilesResponse = slack.methods(token).filesUploadV2(r -> r
  .fileUploads(Arrays.asList(
    FilesUploadV2Request.FileUpload.builder()
      .file(new java.io.File("./logo.png"))
      .filename("logo.png")
      .title("Company Logo")
      .build(),
    FilesUploadV2Request.FileUpload.builder()
      .file(new java.io.File("./2022-03-01-meeting-minutes.md"))
      .filename("2022-03-01-meeting-minutes.md")
      .title("2022-03-01 Meeting Minutes")
      .snippetType("text")
      .build()
  ))
  .channel("C123456")
  .initialComment("Here are the files I mentioned in the meeting :wave:")
);
List<com.slack.api.model.File> v2Files = v2MultiFilesResponse.getFiles();

When migrating to the v2 method, please note that the new method requires both files:write and files:read scopes. If your existing apps have only files:write scope for uploading files, you need to add files:read to the scopes plus re-install the app to issue an updated token. UPDATE: When you use v1.34.0 or newer, the method returns full file metadata without files:read scope.

Slack#close() method now terminates underlying thread pools.

Since this version, Slack instances are compatible with AutoCloseable interface. The Slack#close() method safely terminates its underlying thread pools managed by SlackConfig instance. This can be beneficial especially for resource intensive apps.

Changes

  • [slack-api-model] #1047 Add share_shortcut block support (for the new beta platform) - Thanks @seratch
  • [slack-api-client] #1065 Add files.upload v2 support - Thanks @seratch
  • [slack-api-client] #1063 Fix #1061 Add message metadata support for response_url / Incoming Webhooks calls - Thanks @baole
  • [slack-api-client] #1064 Fix #1060 Enable Slack#close() method to shutdown thread pools behind its SlackConfig - Thanks @seratch @CarlosMOGoncalves
  • [slack-api-client] #1059 Fix #1058 Add include_all_metadata to conversations.replies arguments - Thanks @scarytom
  • [bolt] #1051 Fix NPE when initializing App's status in 3-args constructor - Thanks @musketyr
  • [bolt-micronaut] #1049 Fix #1048 bolt-micronaut does not support the OAuth flow - Thanks @musketyr
  • [bolt-micronaut] #1053 Fix #1052 CommandsTest for Bolt Micronaut does not work - Thanks @musketyr