# 网络回调 (WebHooks)

## Webhook 是什麼？

在網頁應用程式中某項作業完成或特定事件發生時，**能夠即時接收通知的功能**。在 Listly 提取資料後，連動到 Slack 等企業用訊息應用程式，就能在資料提取完成時即時接收通知。

***

## 使用方法

### Slack Webhook 連動

{% hint style="info" %}
**超簡單跟著做**

➡️ 在 Slack 新增 Incoming Message 應用程式 ➡️ 在 Listly 任務新增 Webhook ➡️ 用資料重新提取或排程器在想要的 Slack 頻道接收通知
{% endhint %}

{% stepper %}
{% step %}
**登入 Slack 後，點擊左側邊欄的工作區名稱（範例：Acme Inc.）**

出現 **`工具及設定選單`** 時，點擊 **`應用程式管理設定`** 開啟應用程式目錄。

<figure><img src="/files/969448b88d41c55e073ec9b297617717b5396041" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**在 Slack 應用程式目錄頁面搜尋 'Incoming Webhooks' 或 '接收 Webhook' 並新增到 Slack。**

<figure><img src="/files/c60ff7237234f5312218e42473b1cca300a0dc17" alt=""><figcaption></figcaption></figure>

新增到 Slack 後，選擇要接收通知的頻道。在此步驟可以新增想要接收通知的頻道，也可以設定傳送提取結果訊息的機器人名稱。複製 Listly 服務連動所需的 **`Webhook URL`** 後，點擊儲存設定。

<figure><img src="/files/3d485e43562dc9deb5e3940bf0a9e86b66538263" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
在 Listly [資料面板](https://www.listly.io/databoard)找到想要接收結果通知的任務，點擊右側的 **`資料`** 按鈕。然後如下圖所示，點擊上方選單右側的 **`Hook`** 按鈕開啟 Webhook 設定視窗。

<figure><img src="/files/5eaf1f48c75d9afde8ddd6ef469f817260d95696" alt=""><figcaption></figcaption></figure>

看到 Webhook 設定視窗後，請依下列設定填入 Request Method、JSON 值。在 URL 輸入框輸入前一步驟複製的 **`Webhook URL`**。

<figure><img src="/files/dd7b429c7be0f2ae58e554de2d734df3df6f2979" alt=""><figcaption></figcaption></figure>

| Method | POST |
| ------ | ---- |

JSON:

{% code title="payload.json" %}

```json
{ "text": "#taskkey is #status. <[https://www.listly.io/single?key=#taskkey\&tab=4\&card=30\|See](https://www.listly.io/single?key=#taskkey\&tab=4\&card=30%7CSee) result>\nFrom Listly.", "icon_emoji": ":white_check_mark:" }
```

{% endcode %}
{% endstep %}

{% step %}
用重新提取或排程器重新提取該任務的資料，就能如下在 Slack 接收資料提取通知訊息。

<figure><img src="/files/d6de997e8caea6808a8d6fb3a1b6f7f325e73524" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### 其他設定

* 如果熟悉 JSON 格式，可以在上面輸入的 JSON 中新增 **`channel: #頻道名稱`** 或 **`user: @使用者名稱`** 來變更接收通知的頻道/使用者。新增 **`username: 機器人名稱`** 也可以變更傳送通知的機器人名稱。
* 如想更詳細了解 Slack Incoming Webhooks，請參考 Slack 提供的文件（<https://api.slack.com/legacy/custom-integrations/messaging/webhooks）。>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.listly.io/docs/zh-hant/getting-started/result-page-features-zh-hant/webhooks-zh-hant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
