メインコンテンツへスキップ
A Feishu Channel gives agents in one org a single hotline into a Feishu group: outbound notifications and interactive Approve / Reject cards (via the approval_gate hook). This guide walks through the end-to-end setup. It assumes FIM One is reachable at a stable HTTPS origin — call this API_BASE_URL (e.g. https://one.yourdomain.com).

1. Feishuアプリを作成する

  1. Feishu Open Platformにアクセスして、Create custom app for enterpriseをクリックします。
  2. 名前、アイコン、簡単な説明を入力します。組織のエンドユーザーはカード上でこれらを表示します。
  3. Credentials & Basic Infoページで、App IDとApp Secretをコピーします。これらはステップ4でFIM Oneに貼り付けます。
App Secretはパスワードのように扱ってください。FIM Oneは保存時に暗号化しますが、平文コピーを持つ誰もがボットになりすまし可能です。

2. パーミッションを付与する

Permissions & Scopes で、以下のスコープを有効にしてパーミッションバージョンを送信します:

3. Enable event subscriptions (leave the Request URL blank for now)

Open Event Subscriptions, but don’t fill in the Request URL yet — you get it from FIM One in step 5. Subscribe the following events:
  • card.action.trigger — Approve / Reject button clicks
Under the same page, set an Encrypt Key (required: FIM One rejects a Feishu channel without one, and uses it to verify and decrypt callbacks) and optionally a Verification Token.

4. Add the Channel in FIM One

  1. Sign in as an Org Owner or Admin.
  2. Go to Organization Settings → Channels → New Channel.
  3. Pick Feishu as the type, then fill in:
  4. Click Browse chats — FIM One calls Feishu with your credentials and lists every group the bot is currently a member of.
If the list is empty, the bot hasn’t been added to any group yet. Open Feishu, add the bot to the target group, then reopen the picker.
  1. Pick the group chat you want to route to, click Save.

5. Feishuでコールバック URLを登録する

保存後、FIM One はチャネル詳細パネルにコールバック URLを表示します。形式は以下の通りです:
これをコピーして、Feishu のイベント購読ページに戻り、リクエスト URLとして貼り付けて、検証をクリックします。Feishu は 1 回限りの url_verification チャレンジを POST します。FIM One が自動的に応答します。

6. テストメッセージを送信

FIM One チャネル詳細パネルに戻り、Send test message をクリックします。短いプレーンテキストメッセージ(FIM One test message from <your email>)が1秒以内にターゲットグループに表示されるはずです。 表示されない場合:
  • 401 / 403 — App Secret を再確認し、ステップ2のスコープを再度有効にして、権限バージョンを再公開します。
  • Silent failure — ボットが実際にグループに参加していることを確認し(ステップ4のピッカー)、チャネル行の is_active が true であることを確認します。
  • Verification fails on step 5 — API_BASE_URL が HTTPS であり、公開でアクセス可能であることを確認します。Feishu は非 HTTPS リクエスト URL を拒否します。

7. Wire up an agent (optional — approvals)

To gate tool calls behind group approval:
  1. On the tool / connector action, flip Requires confirmation on.
  2. In the agent editor’s Approval section, pick this channel as the Approval channel and set the mode to Auto or Channel only. The gate is attached to every agent automatically; no hook configuration is needed.
  3. Set the Approver scope (initiator, agent owner, or any org member). Approvers must have linked their Feishu account to their FIM One user, otherwise their click is ignored.
When the agent tries to run a gated tool, an interactive card posts to the group with Approve / Reject. The tool waits (SSE stream pauses) until a permitted approver taps one; the verdict streams back and the agent either completes or aborts.

トラブルシューティング

chat_id をピッカーなしで見つける

チャットを閲覧 UI が推奨されるフローです。生の ID が必要な場合(例えば、スクリプティングから POST /api/channels を呼び出す場合)、3 つのフォールバックがあります: a. Feishu に対して curl を実行する
レスポンス内のすべての items[].chat_id(oc_ というプレフィックスが付いている)は候補です。 b. Feishu API Explorer Feishu Open Platform コンソールで、Dev Tools → API Explorer を開き、/open-apis/im/v1/chats を見つけ、tenant_access_token 認証を選択して、Invoke をクリックします。Feishu がトークンを生成します — シェルは不要です。 c. Feishu クライアントからコピーする Feishu デスクトップまたはモバイル クライアントで、グループを開き、グループ設定 → グループ情報 に移動します。一部のバージョンでは グループ ID をコピー オプションが表示されます。可用性はクライアント バージョンと管理者が設定した権限によって異なるため、これは最も信頼性の低いフォールバックです。

カードクリックがFIM Oneに到達しない(エラー200340)

Feishuクライアントで承認または却下をクリックすると出错了,请稍后重试 code: 200340が表示される場合は、以下のリストを順に確認してください:
  1. card.action.triggerがサブスクライブされている必要があります(ステップ3)。サブスクライブする前に承認ゲートを有効にした場合は、Feishuコンソールで再度サブスクライブをクリックしてください。
  2. コールバックURLを再度保存します。 Feishuは再起動後も残る古いサブスクリプション状態をキャッシュすることがあります。URL検証ハンドシェイクがまだ成功していても、イベントルーティングが静かに停止することがあります。Feishu開放プラットフォームのイベントサブスクリプションページを開き、同じコールバックURLを再度入力して、保存/検証をもう一度クリックしてください。URLは1回のラウンドトリップで再検証され、次のボタン押下でライブボタンクリックが流れ始めます。これは昨日は機能していたチャネルが、コード変更なしで今日停止した場合の最も一般的な修正方法です。
  3. Feishu開放プラットフォームのイベントデバッガーを確認します(事件与回调 → 事件调试)。各ボタン押下は配信ステータス(2xx / 4xx / 未投递)とともにそこに表示されるはずです。未投递が表示される場合、Feishu自体が送信前にイベントを拒否しています。通常、スコープが不足しているか、サブスクリプションが無効になっています。
  4. スコープチェック。 权限管理で、アプリがim:messageおよびテナントが必要とするcard関連のスコープを持っていることを確認してください。スコープが不足していると、サブスクリプションがUIで緑色で表示されていても、配信時にイベントが静かにドロップされます。

承認/却下ボタンは何度もクリックできます

webhookは最初の決定時に置き換えカードを返すようになりました — ボタンが削除され、カードヘッダーが緑色(承認)または赤色(却下)に切り替わります。最初のクリック後もクリック可能なボタンが表示される場合は、Feishuクライアントがキャッシュされたコピーを表示している可能性があります。チャットを再度開くと、決定されたカードが正しくレンダリングされます。

One org, two Feishu channels

An approval goes to the channel chosen as the agent’s Approval channel, and to no other. Several Feishu channels in one org (staging and production groups, say) coexist; bind each agent to the one it should use. A click counts only on the channel that delivered the card.