Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/assets/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ a.headerlink {
display: none !important;
}

h2 {
margin-top: -120px;
padding-top: 120px;
}

.section-title {
font-size: 2rem;
line-height: 2.5rem;
Expand Down
1 change: 1 addition & 0 deletions docs/guides/app-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ All your app needs to do to properly handle OAuth Flow are:
* Provide the endpoints to navigate installers for the completion/cancellation of the installation flow
* The URLs are usually somewhere else but Bolt has simple functionality to serve them

---
## Examples

Here is a Bolt app demonstrating how to implement OAuth flow. As the OAuth flow handling features are unnecessary for many custom apps, those are disabled by default. **App** instances need to explicitly call `asOAuthApp(true)` to turn on them.
Expand Down
1 change: 1 addition & 0 deletions docs/guides/app-home.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All your app needs to do to provide Home tabs to your app users are:

Most commonly, [`"app_home_opened"`](https://api.slack.com/events/app_home_opened) events would be used as the trigger to call the [**views.publish**](https://api.slack.com/methods/views.publish) method. Subscribing this event type is useful particularly for the initial Home tab creation. But it's also fine to publish Home tabs by any other means.

---
## Examples

**NOTE**: If you're a beginner to using Bolt for Slack App development, consult [Getting Started with Bolt]({{ site.url | append: site.baseurl }}/guides/getting-started-with-bolt), first.
Expand Down
1 change: 1 addition & 0 deletions docs/guides/audit-logs-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The Audit Logs API can be used by security information and event management (SIE

Follow the instructions in [the API document](https://api.slack.com/docs/audit-logs-api) to get a valid token for using Audit Logs API. Your Slack app for Audit Logs API needs to be installed on the Enterprise Grid Organization, not an individual workspace within the organization.

---
## Call Audit Logs API in Java

It's straight-forward to call Audit Logs API using **slack-api-client** library.
Expand Down
10 changes: 10 additions & 0 deletions docs/guides/bolt-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lang: en

This guide covers all the basics of Bolt app development. If you're not yet familiar with Slack app development in general, we recommend reading [An introduction to Slack apps](https://api.slack.com/start/overview).

---
## Start with the App class

The **App** class is a place to write only essential parts of your Slack app without being bothered by trifles.
Expand All @@ -25,6 +26,7 @@ app.command("/echo", (req, ctx) -> {
});
```

---
## Dispatching Events

Here is the list of the available methods to dispatch events.
Expand All @@ -45,6 +47,7 @@ Here is the list of the available methods to dispatch events.
|**app.dialogCancellation**|callback_id **String** \| **Pattern**|**Dialogs**: Responds to the events where users close dialogs by clicking Cancel buttons.|
|**app.attachmentAction**|callback_id: **String** \| **Pattern**|**Legacy Messaging**: Responds to user actions in **attachments**. These events can be triggered in only messages.|

---
## Development Guides by Feature

On these guide pages, you'll find a more concrete example code for each.
Expand All @@ -57,6 +60,7 @@ On these guide pages, you'll find a more concrete example code for each.
* [**Events API**]({{ site.url | append: site.baseurl }}/guides/events-api)
* [**App Distribution (OAuth Flow)**]({{ site.url | append: site.baseurl }}/guides/app-distribution)

---
## Acknowledge Incoming Requests

Actions, commands, and options events must always be acknowledged using the `ack()` method. All such utility methods are available as the instance methods of a **Context** object.
Expand Down Expand Up @@ -102,6 +106,7 @@ app.command("/ping", (req, ctx) -> {
});
```

---
## Respond to User Actions

Are you already familiar with `response_url`? If not, we recommend reading [this guide](https://api.slack.com/interactivity/handling#message_responses) first.
Expand All @@ -123,6 +128,7 @@ app.command("/hello", (req, ctx) -> {
});
```

---
## Use Web APIs / Reply using say utility

When you need to call some Slack Web APIs in Bolt apps, use `ctx.client()` for it. The **MethodsClient** created by the method already holds a valid bot token. So, you don't need to give a token to it. Just calling a method with parameters as below works for you.
Expand Down Expand Up @@ -176,6 +182,7 @@ app.command("/my-search", (req, ctx) -> {
});
```

---
## Use Logger

You can access [SLF4J](http://www.slf4j.org/) logger in **Context** objects.
Expand Down Expand Up @@ -204,6 +211,7 @@ If you use the [**ch.qos.logback:logback-classic**](https://search.maven.org/art
</configuration>
```

---
## Middleware

Bolt offers chaining middleware supports. You can customize **App** behavior by weaving a kind of filter to all events.
Expand Down Expand Up @@ -264,10 +272,12 @@ A set of the built-in middleware precedes your custom middleware. So, if the app

The most common would be the case where a request has been denied by **RequestVerification** middleware. After the denial, any middleware won't be executed, so that the above middleware also doesn't work for the case.

---
## Supported Web Frameworks

Refer to [this page]({{ site.url | append: site.baseurl }}/guides/supported-web-frameworks) for more details.

---
## Deployments

[We're planning](https://github.com/slackapi/java-slack-sdk/issues/348) to have some guide documents for deployments.
2 changes: 2 additions & 0 deletions docs/guides/composing-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This section shows how to build Slack messages using **slack-api-client** librar

Also, before jumping into Java code, we recommend developing an understand of composing Slack messages. [Read the API documentation](https://api.slack.com/messaging/composing) for more information.

---
## Text Formatting

Composing a text message is the simplest way to post a message to Slack conversations.
Expand All @@ -32,6 +33,7 @@ ChatPostMessageResponse response = slack.methods(token).chatPostMessage(req -> r

As you see, using `text` is fairly simple. The only thing to know is to give a string value with a valid format. Consult [Basic formatting with `mrkdwn`](https://api.slack.com/reference/surfaces/formatting#basics) for understanding the markup language.

---
## Building Blocks for Rich Message Layouts

[Block Kit](https://api.slack.com/block-kit) is a UI framework for Slack apps that offers a balance of control and flexibility when building experiences in messages and other [surfaces](https://api.slack.com/surfaces).
Expand Down
1 change: 1 addition & 0 deletions docs/guides/events-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All you need to do to handle Events API requests are:

Your app has to respond to the request within 3 seconds by `ack()` method. Otherwise, the Slack Platform may retry after a while.

---
## Examples

**NOTE**: If you're a beginner to using Bolt for Slack App development, consult [Getting Started with Bolt]({{ site.url | append: site.baseurl }}/guides/getting-started-with-bolt), first.
Expand Down
4 changes: 1 addition & 3 deletions docs/guides/getting-started-with-bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ This guide explains how to start your first-ever Bolt app.
If you're not yet familiar with Slack app development in general, we recommend reading [An introduction to Slack apps](https://api.slack.com/start/overview).

---

## Project Setup

Let's start building a Slack app with Bolt! This guide shows how to set up a Bolt project with Maven, and Gradle.
Expand Down Expand Up @@ -70,7 +69,6 @@ dependencies {
```

---

## Run Your Bolt App in 3 Minutes

### Use **bolt-jetty**
Expand Down Expand Up @@ -230,7 +228,6 @@ public class SlackAppController extends SlackAppServlet {
Check [the detailed guide here]({{ site.url | append: site.baseurl }}/guides/supported-web-frameworks) for further information.

---

## Getting Started in Kotlin

For code simplicity, [Kotlin](https://kotlinlang.org/) language would be a great option for writing Bolt apps. In this section, you'll learn how to set up a Kotlin project for Bolt apps.
Expand Down Expand Up @@ -308,6 +305,7 @@ From here, all you need to do is write code and restart the app. Enjoy Bolt app

**Pro tip**: We strongly recommend using [IntelliJ IDEA](https://www.jetbrains.com/idea/) here even if you don't prefer using IDEs. The IDE is the smoothest way to try Kotlin application development.

---
## Next Steps

Read the [Bolt Basics]({{ site.url | append: site.baseurl }}/guides/bolt-basics) for further information.
Expand Down
1 change: 1 addition & 0 deletions docs/guides/incoming-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ To enable this feature, visit the [Slack App configuration page](http://api.slac

Then, install the app to your development workspace. Each time your app is installed, a new Webhook URL will be generated.

---
## How To Use

Here is a **curl** command example demonstrating how to send a message via an Incoming Webhooks URL.
Expand Down
1 change: 1 addition & 0 deletions docs/guides/interactive-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All your app needs to do to handle Slack requests by user interactions are:

Your app has to respond to the request within 3 seconds by `ack()` method. Otherwise, the user will see the timeout error on Slack. For some of the requests including external selects, having valid parameters to the method may be required.

---
## Examples

**NOTE**: If you're a beginner to using Bolt for Slack App development, consult [Getting Started with Bolt]({{ site.url | append: site.baseurl }}/guides/getting-started-with-bolt), first.
Expand Down
1 change: 1 addition & 0 deletions docs/guides/ja/app-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Bolt アプリが OAuth フローをハンドルするためにやらなけれ
* インストールを実行したユーザーを誘導する完了・エラーページを用意する
* これらの URL は通常別のどこかであることが多いが、Bolt アプリがそれをサーブすることも可能

---
## コード例

以下は OAuth フローの実装例です。OAuth フローのハンドリング機能は多くのカスタムアプリには必要ないので、Bolt のデフォルトの状態ではこの機能は無効化されています。**App** インスタンスは、それを有効にする場合は `asOAuthApp(true)` を明に呼び出す必要があります。
Expand Down
1 change: 1 addition & 0 deletions docs/guides/ja/app-home.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Bolt アプリが Home タブの提供のためにやらなければならない

よくある手法としては [`"app_home_opened"`](https://api.slack.com/events/app_home_opened) のイベントを使って [**views.publish**](https://api.slack.com/methods/views.publish) API メソッドを呼び出すきっかけに使うという実装があります。特に初回更新にはこのイベントの利用が必要です。しかし、それ以外のタイミング・手段で Home タブを更新することも全く問題ありません。

---
## コード例

**注**: もし Bolt を使った Slack アプリ開発にまだ慣れていない方は、まず「[Bolt 入門]({{ site.url | append: site.baseurl }}/guides/ja/getting-started-with-bolt)」を読んでください。
Expand Down
1 change: 1 addition & 0 deletions docs/guides/ja/audit-logs-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Audit Logs API は、各種 SIEM (Security Information and Event Management) ツ

Audit Logs API で利用できるトークンの取得は「[Monitoring workspace events with the Audit Logs API(英語)](https://api.slack.com/docs/audit-logs-api)」で解説されている手順に従ってください。Audit Logs API を利用する Slack アプリは、通常のアプリのように個々のワークスペース単位でインストールするのではなく OrG レベルでインストールする必要があります。

---
## Audit Logs API を Java で利用

**slack-api-client** を使った Audit Logs API の呼び出しは、以下のコードのようなわかりやすいアプローチです。
Expand Down
10 changes: 10 additions & 0 deletions docs/guides/ja/bolt-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lang: ja

このガイドは、Bolt を使ったアプリ開発の基礎的な内容を全てカバーします。なお Slack アプリ開発全般についてまだ不慣れな方は、まず「[An introduction to Slack apps(英語)](https://api.slack.com/start/overview)」に軽く目を通した方がよいかもしれません。

---
## App クラス

**App** クラスは、些末なことに煩わされることなく、その Slack アプリの本質的なロジックだけを書くことができる場所です。
Expand All @@ -25,6 +26,7 @@ app.command("/echo", (req, ctx) -> {
});
```

---
## イベントのディスパッチ

以下は、利用可能なイベントをディスパッチするためのメソッドの一覧です。
Expand All @@ -45,6 +47,7 @@ app.command("/echo", (req, ctx) -> {
|**app.dialogCancellation**|callback_id **String** \| **Pattern**|**ダイアログ**: ダイアログが閉じたときのイベントに応答します。|
|**app.attachmentAction**|callback_id: **String** \| **Pattern**|**旧式のメッセージ**: **attachements** 内で発生したユーザアクションに応答します。これらのイベントはメッセージのみで発火します。|

---
## 機能ごとの開発ガイド

以下のガイドページで、それぞれの機能について具体的なコード例を見つけることができます。
Expand All @@ -57,6 +60,7 @@ app.command("/echo", (req, ctx) -> {
* [**イベント API**]({{ site.url | append: site.baseurl }}/guides/ja/events-api)
* [**アプリの配布 (OAuth Flow)**]({{ site.url | append: site.baseurl }}/guides/ja/app-distribution)

---
## リクエストを ack する

アクション、コマンド、選択肢読み込みなどのイベントでのリクエストに対しては、必ず `ack()` メソッドで応答を返す必要があります。`ack()` に限らず、このようなユーティリティは全て **Context** オブジェクトのインスタンスメソッドとして定義されています。
Expand Down Expand Up @@ -102,6 +106,7 @@ app.command("/ping", (req, ctx) -> {
});
```

---
## ユーザーアクションに respond する

`response_url` についてすでにご存知ですか?もしまだでしたら、まず「[Handling user interaction in your Slack apps > Message responses(英語)](https://api.slack.com/interactivity/handling#message_responses)」を読むことをおすすめします。
Expand All @@ -123,6 +128,7 @@ app.command("/hello", (req, ctx) -> {
});
```

---
## Web API の利用 / ユーザーへの返事を say する

Web API を Bolt アプリ内で利用したいときは `ctx.client()` を使います。このメソッドが返す **MethodsClient** はあらかじめボットトークンを保持しています。そのため、トークンを渡す必要はありません。ただパラメーターを指定して呼び出すだけで OK です。
Expand Down Expand Up @@ -176,6 +182,7 @@ app.command("/my-search", (req, ctx) -> {
});
```

---
## ロギング

**Context** オブジェクトから [SLF4J](http://www.slf4j.org/) のロガーにアクセスできます。
Expand Down Expand Up @@ -204,6 +211,7 @@ SLF4J の実装として [**ch.qos.logback:logback-classic**](https://search.mav
</configuration>
```

---
## ミドルウェア

Bolt はチェインするミドルウェアの仕組みを提供しています。フィルターのような処理を全てのイベントに対して適用することで **App** の挙動をカスタマイズすることができます。
Expand Down Expand Up @@ -263,10 +271,12 @@ Bolt に標準で組み込まれているミドルウェアはアプリ側で追

最もよくあるパターンは **RequestVerification** ミドルウェアでリクエストが拒否される場合です。この拒否のあとは、他のどのミドルウェアも実行されないため、上記のサンプル例のミドルウェアも同様に動作しません。

---
## 対応している Web フレームワーク

[こちらのページ]({{ site.url | append: site.baseurl }}/guides/ja/supported-web-frameworks)を参考にしてください。

---
## デプロイ

デプロイについてのガイドを公開することを[予定しています](https://github.com/slackapi/java-slack-sdk/issues/348)。
2 changes: 2 additions & 0 deletions docs/guides/ja/composing-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lang: ja

また、Java でのコーディングに入る前に「[An overview of message composition(英語)](https://api.slack.com/messaging/composing)」を一読して、Slack メッセージの組み立て方について理解を深めることをおすすめします。

---
## テキストの整形

text でメッセージを作成することが、Slack のチャンネルにメッセージを投稿するための最もシンプルなやり方です。
Expand All @@ -32,6 +33,7 @@ ChatPostMessageResponse response = slack.methods(token).chatPostMessage(req -> r

見ての通り、`text` を使うのはとてもシンプルです。知らなければならないことは、正しい形式の文字列を指定する方法だけです。Slack でのマークアップ方式については「[Basic formatting with `mrkdwn`(英語)](https://api.slack.com/reference/surfaces/formatting#basics)」を参照してください。

---
## Block を使ったリッチなレイアウト

[Block Kit](https://api.slack.com/block-kit) は、メッセージやその他の[サーフェスエリア](https://api.slack.com/surfaces)で利用することができる Slack アプリのための UI フレームワークです。Block Kit は優れたバランスで UI の制御と柔軟性を提供します。
Expand Down
1 change: 1 addition & 0 deletions docs/guides/ja/events-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Bolt アプリがイベントへの応答のためにやらなければならな

Bolt アプリは Slack API サーバーからのリクエストに対して 3 秒以内に `ack()` メソッドで応答する必要があります。3 秒以内に応答しなかった場合、Slack API は一定時間経過後にリトライします。

---
## コード例

**注**: もし Bolt を使った Slack アプリ開発にまだ慣れていない方は、まず「[Bolt 入門]({{ site.url | append: site.baseurl }}/guides/ja/getting-started-with-bolt)」を読んでください。
Expand Down
4 changes: 1 addition & 3 deletions docs/guides/ja/getting-started-with-bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ lang: ja
なお Slack アプリ開発全般についてまだ不慣れな方は、まず「[An introduction to Slack apps(英語)](https://api.slack.com/start/overview)」に軽く目を通した方がよいかもしれません。

---

## プロジェクトのセットアップ

では、さっそく Bolt を使った Slack アプリ開発を始めましょう!このガイドでは Maven、Gradle を使ったプロジェクトセットアップの手順を説明します。
Expand Down Expand Up @@ -70,7 +69,6 @@ dependencies {
```

---

## 3 分間で動かす Bolt アプリ

### **bolt-jetty** の利用
Expand Down Expand Up @@ -231,7 +229,6 @@ public class SlackAppController extends SlackAppServlet {
より詳細な情報は[こちらのガイド]({{ site.url | append: site.baseurl }}/guides/ja/supported-web-frameworks)を参考にしてください。

---

## Kotlin での設定

コードをより簡潔にするために Java の代わりに [Kotlin](https://kotlinlang.org/) で Bolt アプリを書くことはとても良い選択肢です。このセクションでは、Bolt アプリを Kotlin で開発するための設定手順を紹介します。
Expand Down Expand Up @@ -309,6 +306,7 @@ gradle run

**Pro tip**: もしあなたがあまり IDE を使うことが好みでないとしても Kotlin を使うなら [IntelliJ IDEA](https://www.jetbrains.com/idea/) を使うことを強くおすすめします。この IDE を使うことがもっともスムースな Kotlin アプリ開発の方法です。

---
## 次のステップ

「[Bolt の概要]({{ site.url | append: site.baseurl }}/guides/ja/bolt-basics)」を読んでさらに理解を深めてください。
Expand Down
1 change: 1 addition & 0 deletions docs/guides/ja/incoming-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lang: ja

その次に、そのアプリを開発用ワークスペース(Development Workspace)にインストールします。アプリをインストールする度に新しい Webhook の URL が発行されます。

---
## 使い方

まず、Incoming Webhook URL を使ってどのようにメッセージを送信するかを示す **curl** コマンドの例を見ておきましょう。
Expand Down
Loading