Releases: slackapi/java-slack-sdk
version 1.27.0
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
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/67?closed=1
- All changes: v1.26.1...v1.27.0
version 1.26.1
Changes
- [slack-api-client] #1068 Fix context.teamId for view interactions in a Slack Connect channel - Thanks @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/69?closed=1
- All changes: v1.26.0...v1.26.1
version 1.26.0
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:
- Call
MethodsClient#filesGetUploadURLExternal()
method to receive a URL to use for each file - Perform an HTTP POST request to the URL you received in step 1 for each file
- Call
MethodsClient#filesCompleteUploadExternal()
method with the pairs of file ID and title to complete the whole process, plus share the files in a channel - 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 UPDATE: When you use v1.34.0 or newer, the method returns full file metadata without 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.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 itsSlackConfig
- Thanks @seratch @CarlosMOGoncalves - [slack-api-client] #1059 Fix #1058 Add
include_all_metadata
toconversations.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
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/68?closed=1
- All changes: v1.25.1...v1.26.0
version 1.25.1
Changes
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/66?closed=1
- All changes: v1.25.0...v1.25.1
version 1.25.0
Changes
- [slack-api-client] #1039 Fix #1038
BlockActionPayload
is missingapp_unfurl
information - Thanks @seratch @kfmartin - [slack-api-model] #1030 Fix #1029
RichTextListElement
have does not haveborder
andoffset
fields - Thanks @seratch @harinandan-reddy - [all] #1031 Upgrade gson patch version and other optional ones - Thanks @seratch
- [bolt-servlet] #1026 #1027 Upgrade jetty dependancies due to CVE-2022-2048 and CVE-2022-2047 - Thanks @seratch @otlg
- [bolt] #1033 Upgrade ktor/http4k minor versions - Thanks @seratch
- [bolt] #1025 Improved readability of tests - Thanks @WilliamBergamin
Document Changes
- #1024 Fix typos in javadoc, comments and documentations Updates - Thanks @marcwrobel
- #1037 #1036 The filetype API method doc has an unformated/invalid link to file types - Thanks @filmaj
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/65?closed=1
- All changes: v1.24.0...v1.25.0
version 1.24.0
Announcements
Embedding videos in Block Kit
Block Kit now supports embedding a video in any surface areas. Check the document and example code:
- https://api.slack.com/reference/block-kit/blocks#video
- https://github.com/slackapi/java-slack-sdk/blob/v1.24.0/slack-api-client/src/test/java/test_with_remote_apis/methods/chat_Test.java#L949-L969
bolt-ktor is now compatible with Ktor 2 or newer
Since this version, bolt-ktor module supports only Ktor 2.x. Refer to Ktor team's announcement and migration guide for more details:
Changes
- [slack-api-model] #1020 #1019 Add video block to Block Kit support - Thanks @seratch
- [slack-api-client] #1014 Fix #1013 Update tyrus-standalone-client dependency from 1.18 to 1.19 - Thanks @seratch
- [bolt-servlet] #1022 #1021 bolt-servlet improperly returns 200 OK with empty string to invalid requests - Thanks @seratch
- [bolt-ktor] #1018 #981 Migrate to Ktor v2 (bolt-ktor) - Thanks @WilliamBergamin
- [bolt-aws-lambda] #1016 #1015 Lambda handler class doesn't account for base64 encoded body - Thanks @seratch @harshal-dupare
Document Changes
- Updates tyrus-standalone-client version from 1.17 to 1.19 in the documentations - Thanks @marcwrobel
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/59?closed=1
- All changes: v1.23.1...v1.24.0
version 1.23.1
Changes
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/63?closed=1
- All changes: v1.23.0...v1.23.1
version 1.23.0
Important Notice
Use say method with both text and blocks
Since this version, Bolt's say()
utility accepts both text
and blocks
at a time. When you pass blocks
to the method, it'd be recommended to add text
string too. At a glance, the text
value may look duplicated, but having it would be valuable for better user experience such as meaningful mobile notification message and accessibility support.
HTTP_PROXY / HTTPS_PROXY env variables are now used
Since this version, the default initialization of SlackConfig
tries to load HTTP_PROXY
/ HTTPS_PROXY
env variables, which are common practices to set the proxy server URL to use, if they exist. If you want to use a different proxy URL, you can set the URL using the setter methods.
OkHttp version 4.10
Since this version, this SDK uses OkHtttp 4.10 for HTTP requests. Although the version does not bring any big changes, its underlying Okio library has a major version upgrade. Refer to their release notes for details. If you find something unexpected since this version, please let us know in our GitHub issues.
Changes
- [bolt] #1002 Add an overloaded method that accepts both text and blocks to Say - Thanks @seratch
- [slack-api-client] #1003 Fix #992 Automatically resolve the proxy URL by HTTP_PROXY env variable - Thanks @seratch @amarinelli
- [slack-api-client] #1001 Fix #998 Upgrade okhttp version to 4.10 - Thanks @seratch
- [slack-api-cljent] #1000 Add unfurling capabilities to Webhook payload - Thanks @jazcarate
- [slack-api-client] #1004 Fix a bug where constructing
blocks
/attachments
etc. using anonymous inner class initialization - Thanks @WilliamBergamin - [slack-api-client] #1005 Fix a bug where the workflow step request builder has wrong null validation logic - Thanks @WilliamBergamin
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/58?closed=1
- All changes: v1.22.3...v1.23.0
version 1.22.3
Changes
- [slack-api-client] #997 Add cursor parameter to
reactions.list
API method - Thanks @seratch - [slack-api-client] #999 Fix a bug where DetailedLoggingListener does not print text request body - Thanks @seratch
@WilliamBergamin reported both of the above issues. Thanks a lot!
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/61?closed=1
- All changes: v1.22.2...v1.22.3
version 1.22.2
Changes
- [slack-api-model] #994 Add missing properties to ChannelDeletedEvent - Thanks @seratch
- Upgrade Kotlin version to 1.7 - Thanks @seratch
Document Updates
- #988 #989 Link getting started instructions for gradle to the gradle app quickstart - Thanks @filmaj
- #988 #990 Small improvements to the getting started documents for Bolt - Thanks @filmaj
- #991 Update Japanese documents to have #990 changes - Thanks @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/60?closed=1
- All changes: v1.22.1...v1.22.2