串接 LINE 官方帳號

將 LINE 官方帳號連接到 SomaTrace,讓個案可透過 LINE 取得預約連結,預約資料會同步進入排程。本文依序說明 LINE 後台、LINE Developers 與 SomaTrace 的設定步驟。

將 LINE 官方帳號連接到 SomaTrace 後,個案可從 LINE 取得專屬預約連結,完成預約後資料會直接進入你的排程。系統會依 LINE 身分辨識來客,後續同一位個案再次預約時也能對應到既有紀錄。

設定會在 LINE 官方帳號後台、LINE Developers、SomaTrace 三個地方完成:先在 LINE 啟用 Messaging API,取得 Channel secret 與 Channel access token,貼回 SomaTrace,再將 SomaTrace 產生的 Webhook URL 填回 LINE Developers 並驗證。

開始之前

你需要先準備好:

一個 LINE 官方帳號(Official Account,不是個人 LINE),而且你是它的管理員。還沒有的話,先到 LINE Official Account Manager 免費申請。 在 SomaTrace 裡先把公開預約頁設定好(營業時間、服務項目)。LINE 串接完成後,個案會透過這個頁面送出預約。 LINE 官方帳號串接是 Studio 方案的功能。

串接只需要設定一次。完成後,從 LINE 進來的個案會由系統辨識,不需要逐一重新設定。

個案端流程

設定前可先確認完整使用流程:

個案在 LINE 加入你的官方帳號,或傳訊息給你。 系統辨識為新的「來客」,並回覆一條專屬預約連結。 個案點開連結、選擇時段、填寫資料並送出。 預約會出現在你的「安排」頁,同一位個案下次再預約時也能對應到同一筆資料。

第一部分:在 LINE 啟用 Messaging API

1. 打開 LINE Official Account Manager,點右上角的「設定」。

!在 LINE 官方帳號後台右上角點「設定」

2. 左側選單點「Messaging API」,再點綠色的「啟用 Messaging API」。

!左側選 Messaging API,點啟用 Messaging API

3. 選「建立服務提供者」,填入你的工作室名稱,點「同意」。

!建立服務提供者並填入工作室名稱

服務提供者(Provider)一旦建立並連上 Messaging API 就無法刪除或更名,填之前確認一下名稱。

4. 隱私權政策與服務條款這頁可以留空,直接點「確定」。

!隱私權政策與服務條款頁,直接按確定

5. 確認帳號名稱與服務提供者沒問題,點「確定」啟用。

!確認資訊後按確定啟用 Messaging API

6. 確認狀態顯示為「使用中」。

!Messaging API 狀態顯示為使用中

第二部分:複製 Channel secret 與 access token

接下來到 LINE Developers 複製串接需要的憑證。

7. 前往 LINE Developers,點右上角的「Console」。

!在 LINE Developers 首頁點右上角 Console

8. 在左邊選到前面建立的服務提供者,點進你的官方帳號(Messaging API)。

!選擇服務提供者後點進官方帳號的 Messaging API channel

9. 進到 channel 後,先停在「Basic settings」分頁,往下滑。

!選擇 Basic settings 分頁並往下滑

10. 找到「Channel secret」,複製這串內容。

!複製 Channel secret

11. 回到上方,切到「Messaging API」分頁。

!切換到 Messaging API 分頁

12. 往下滑到「Channel access token (long-lived)」,點「Issue」核發。

!在 Channel access token (long-lived) 區塊點 Issue

13. 複製這串 Channel access token。

!複製 Channel access token (long-lived)

請先保留 Channel secret 與 Channel access token。下一步會將它們貼到 SomaTrace。

第三部分:貼回 SomaTrace 串接

14. 打開 SomaTrace,到「安排 → 經營 → 公開預約頁」。

!SomaTrace 安排頁的經營分頁,點公開預約頁

15. 往下滑到「外部整合 → LINE 官方帳號」,點開。

!公開預約頁往下滑,展開 LINE 官方帳號區塊

16. 將前一步複製的 Channel secret 與 Channel access token 貼進對應欄位,點「串接」。

!貼上 Channel secret 與 Channel access token 後點串接

第四部分:把 Webhook 填回 LINE 並驗證

串接成功後,SomaTrace 會產生一條 Webhook 網址。這是 LINE 將訊息事件傳送回 SomaTrace 的端點,需填回 LINE Developers。

17. 在 SomaTrace 的 LINE 區塊,點「複製」複製 Webhook 網址。

!在 SomaTrace 複製 Webhook 網址

18. 回到 LINE Developers 的「Messaging API」分頁,找到 Webhook URL,點「Edit」。

!在 LINE Developers 的 Webhook settings 點 Edit

19. 貼上前一步複製的網址,點「Update」。

!貼上 Webhook URL 後點 Update

20. 把「Use webhook」開關打開。

!打開 Use webhook 開關

21. 點「Verify」,看到跳出「Success」即代表 Webhook 已連通。

!點 Verify 後確認跳出 Success

完成之後

回到 SomaTrace 的 LINE 區塊,可以按「測試連線」再次確認串接狀態。完成後也可以視需求設定:

自動成立 LINE 預約:開啟後,個案送出預約會直接成立並收到成功通知;關閉則會先建立為「預約請求」,由你確認後才成立。 預約關鍵字:只有當個案訊息包含設定的關鍵字時,系統才會回覆預約連結。

常見狀況

個案傳訊息卻沒收到預約連結。 先確認 LINE Developers 的「Use webhook」已開啟,並回到 SomaTrace 的 LINE 區塊使用「測試連線」確認 Webhook 狀態。

同一個人出現兩筆紀錄。 同一位個案可能已透過 LINE 建立紀錄,也已由你手動建立另一筆紀錄。可參考 從 LINE 來的個案,怎麼合併 將兩筆資料合併。

Connect your LINE Official Account

Link your LINE Official Account to SomaTrace so clients can find you inside LINE, book in one tap, and have the booking land straight in your schedule. This page walks you through the whole setup, with screenshots at every step.

Once your LINE Official Account is connected to SomaTrace, clients reach you inside the LINE they already use, tap once to book, and you never have to copy anyone into the system by hand. The flow is: a client adds you on LINE, the system recognises them, hands them a personal booking link, they submit it, and the appointment lands directly in your schedule while the client gets a LINE confirmation.

The setup moves between three places — the LINE Official Account Manager, LINE Developers, and SomaTrace: enable the Messaging API in LINE, grab two keys (the Channel secret and the Channel access token), paste them into SomaTrace, then take the Webhook URL SomaTrace gives you and put it back into LINE and verify it. Follow the screenshots below and you won't get lost.

Before you start

You'll need:

A LINE Official Account (not a personal LINE), with you as its admin. If you don't have one yet, create one for free in the LINE Official Account Manager. Your public booking page already set up in SomaTrace (hours, services). Once LINE is connected, this is the page clients book through. LINE Official Account connection is a Studio plan feature.

You only do this setup once. After it's connected, clients arriving from LINE are recognised automatically — you don't repeat this per person.

What the client sees

Understand the goal first, so each step below makes sense:

The client adds your Official Account on LINE, or sends you a message. The system recognises them as a new "visitor" and replies with a personal booking link. They tap the link, pick a time, fill in their details, and submit. The appointment appears in your Schedule, and the same person lines up next time they book.

Part 1 — Enable the Messaging API in LINE

1. Open the LINE Official Account Manager and click "Settings" at the top right.

!Click Settings at the top right of the LINE Official Account Manager

2. In the left menu choose "Messaging API", then click the green "Enable Messaging API".

!Choose Messaging API on the left, then enable it

3. Choose "Create a provider", enter your studio name, and agree.

!Create a provider and enter your studio name

A provider, once created and connected to the Messaging API, cannot be deleted or renamed — double-check the name before you confirm.

4. The privacy policy / terms page can be left blank — just confirm.

!Leave the privacy policy and terms blank, then confirm

5. Confirm the account name and provider look right, then confirm to activate.

!Confirm the details and activate the Messaging API

6. When the status reads "In use", you're done with this part.

!Messaging API status shows In use

Part 2 — Copy the Channel secret and access token

Now switch to LINE Developers to grab the two keys.

7. Go to LINE Developers and click "Console" at the top right.

!Click Console at the top right of LINE Developers

8. On the left, pick the provider you just created, then open your Official Account (Messaging API).

!Select the provider, then open the Official Account's Messaging API channel

9. Inside the channel, stay on the "Basic settings" tab and scroll down.

!Open the Basic settings tab and scroll down

10. Find "Channel secret" and copy it. That's the first key.

!Copy the Channel secret

11. Scroll back up and switch to the "Messaging API" tab.

!Switch to the Messaging API tab

12. Scroll to "Channel access token (long-lived)" and click "Issue".

!Click Issue under Channel access token (long-lived)

13. Copy the Channel access token. That's the second key.

!Copy the Channel access token (long-lived)

Keep both keys handy (a notes app is fine). Next you'll paste them into SomaTrace.

Part 3 — Paste them into SomaTrace

14. Open SomaTrace and go to "Schedule → Business → Public booking page".

!In SomaTrace, open the public booking page from the Business tab

15. Scroll down to "External integrations → LINE Official Account" and expand it.

!Scroll down and expand the LINE Official Account section

16. Paste the two keys into their fields and tap "Connect".

!Paste the Channel secret and access token, then connect

Part 4 — Put the Webhook back into LINE and verify

Once connected, SomaTrace gives you a Webhook URL — the channel LINE uses to send messages back to SomaTrace. The last part is putting it back into LINE.

17. In SomaTrace's LINE section, tap "Copy" to copy the Webhook URL.

!Copy the Webhook URL in SomaTrace

18. Back in LINE Developers, on the "Messaging API" tab, find Webhook URL and click "Edit".

!Click Edit under Webhook settings in LINE Developers

19. Paste the URL you copied and click "Update".

!Paste the Webhook URL and click Update

20. Turn on the "Use webhook" toggle.

!Turn on the Use webhook toggle

21. Click "Verify". When "Success" pops up, you're connected.

!Click Verify and confirm Success appears

Finally, in the LINE Official Account Manager under "Settings → Response settings", turn off auto-reply messages. Otherwise LINE's built-in canned replies override SomaTrace's, and clients never get the booking link. This is the most common snag.

After you're connected

Back in SomaTrace's LINE section you can tap "Test connection" to confirm once more — a green light means you're all set. While you're here you can also set:

Auto-confirm LINE bookings: when on, if a client submits a booking it's confirmed immediately and they get a confirmation; when off, it first arrives as a "booking request" and is only confirmed after you approve it. Booking keywords: the system only replies with a booking link when these words appear in a message, so people just saying hi don't get spammed with a link.

Common situations

A client messages but doesn't get a booking link. First check that "Use webhook" is on and "Auto-reply" is off in the LINE backend. These two settings fight each other, and it's the most common snag.

The same person shows up as two records. The same person sometimes gets created automatically from LINE and also added by you by hand. See Merging clients who come from LINE to fold the two into one thread.