すべてのプロダクト
Search
ドキュメントセンター

Qoder CN シリーズ:チャネルの作成

最終更新日:Jul 04, 2026

アイデンティティとテンプレートに紐付けられた外部 IM チャネルを作成します。

リクエストヘッダー

ヘッダー

必須

説明

Authorization

はい

Bearer <PAT>

Content-Type

はい

application/json

Idempotency-Key

いいえ

安全でないリクエスト用のオプションのべき等キーです。

リクエストボディ

パラメータ

タイプ

必須

説明

identity_id

string

はい

転送アイデンティティの ID です。呼び出し元に属しており、有効化されている必要があります。

template_id

string

はい

チャネルがセッションを作成する際に使用する転送テンプレートの ID です。

channel_type

string

はい

チャネルタイプ。サポートされている値は wechatwecomfeishu、および dingtalk です。

name

string

いいえ

チャネルの表示名です。

channel_config.credentials

object

条件付き

トークンまたはアプリ認証情報を使用するチャネルには必須です。QR 認可チャネルの場合は省略し、後で有効化することも可能です。

channel_config.response_options

object

いいえ

レスポンスの可視性設定です。

リクエストの例

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/channels' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "identity_id": "idn_019eabc123",
    "template_id": "tmpl_support",
    "channel_type": "feishu",
    "name": "Support Feishu channel",
    "channel_config": {
      "credentials": {
        "app_key": "...",
        "app_secret": "..."
      },
      "response_options": {
        "include_tool_calls": false,
        "include_thinking": false
      }
    }
  }'

レスポンスの例

HTTP 201 Created

{
  "id": "ci_019eabc123",
  "type": "channel",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_support",
  "channel_type": "feishu",
  "name": "Support Feishu channel",
  "enabled": true,
  "binding_status": "bound",
  "channel_config": {
    "response_options": {
      "include_tool_calls": false,
      "include_thinking": false
    }
  },
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:00:00Z"
}

レスポンスフィールド

フィールド

タイプ

説明

id

string

チャネル ID。プレフィックスの例は ci_ です。

type

string

常に channel です。

identity_id

string

紐付けられた転送アイデンティティの ID です。

template_id

string

紐付けられた転送テンプレートの ID です。

channel_type

string

外部チャネルタイプです。

enabled

boolean

手動で有効/無効を切り替えるスイッチです。

binding_status

string

未バインドバインド済み、または期限切れ

channel_config.response_options

object

レスポンスの可視性設定です。

エラー

HTTP

タイプ

コード

トリガー

400

invalid_request_error

channel_type_unsupported

チャネルタイプがサポートされていません。

401

authentication_error

TOKEN_INVALID

PAT が無効か、期限切れです。

404

not_found_error

channel_template_not_found

テンプレートが存在しないか、アクセスできません。

404

not_found_error

channel_identity_not_found

アイデンティティが存在しないか、アクセスできません。

409

conflict_error

channel_identity_disabled

アイデンティティが無効化されています。

409

conflict_error

channel_auth_required

必要な認証情報または QR 認可が不足しています。

502

api_error

channel_auth_failed

基盤となるチャネルの認可に失敗しました。

注意

  • user_id は、認証から内部的に導出され、決して公開されません。

  • 新規チャネルは、デフォルトでenabled=trueです。

  • チャネルがインバウンドメッセージを処理できるのは、enabled=true で、かつ binding_status="bound" の場合のみです。

  • チャネルの削除またはアーカイブはサポートされていません。代わりに Update channel API を使用してチャネルを無効化してください。