コンテンツまでスキップ
  • 検索フィールドが空なので、候補はありません。

Outgoing Webhookについて

Kibelaでは、SlackやMicrosoft Teamsなどの外部サービスへの通知にOutgoing Webhookをご利用いただけます。

Outgoing Webhookを使用すると、記事の公開やコメントの投稿などKibela上でイベントが発生した際に、設定されたURLに対してHTTPリクエストを送信できます。

設定方法は「記事の新規作成・更新の通知を設定する」を参照ください。

HTTPリクエストについて

イベント発生時、以下のHTTPリクエストが送信されます。

  • HTTPバージョン: HTTP/1.1
  • HTTPメソッド: POST
  • Content-Type: application/json
  • User-Agent: Kibela-Hookshot/v1 

Request body

HTTPリクエストのRequest bodyには、必ずresource_type、actionパラメータが存在します。

resource_typeはどのリソースに対してイベントが発生したかを表し、actionはどのようなイベントが発生したかを表しています。

イベント: 共同編集が「無効」な記事の投稿

  • resource_type: blog
  • action: create
  • team: イベントが発生したチーム
  • action_user: 投稿したユーザー
  • blog: 投稿されたBlog

サンプルリクエスト

POST /payload HTTP/1.1

Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "create",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "blog": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "boards": [
      {
        "id": "1",
        "name": "Product Team"
      }
    ],
    "content_html": "<h2>sample request</h2>",
    "content_md": "## sample request",
    "id": "1",
    "title": "sample request",
    "url": "https://docs.kibe.la/@kibe/1"
  },
  "resource_type": "blog",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  }
}

 

イベント: 共同編集が「無効」な記事の更新

  • resource_type: blog
  • action: update
  • team: イベントが発生したチーム
  • action_user: 更新したユーザー
  • blog: 更新したBlog

サンプルリクエスト

POST /payload HTTP/1.1

Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "update",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "blog": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "boards": [
      {
        "id": "1",
        "name": "Product Team"
      }
    ],
    "content_html": "<h2>sample request</h2>",
    "content_md": "## sample request",
    "content_diff": "+sample request\n-[WIP]sample request",
    "revision_url": "https://docs.kibe.la/blogs/1/versions/1",
    "id": "1",
    "title": "sample request",
    "url": "https://docs.kibe.la/@kibe/1"
  },
  "notify": true, # 廃止された"更新を知らせる"機能用のパラメータ
  "resource_type": "blog",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  }
}

イベント: 共同編集が「無効」な記事の削除

  • resource_type: blog
  • action: delete
  • team: イベントが発生したチーム
  • action_user: 削除したユーザー
  • blog: 削除されたBlog

サンプルリクエスト

POST /payload HTTP/1.1

Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "delete",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "blog": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "boards": [
      {
        "id": "1",
        "name": "Product Team"
      }
    ],
    "comments": [
      {
        "author": {
          "account": "kibe",
          "avatar_photo": {
            "url": "https://cdn.kibe.la/media/public/1/kibe.png"
          },
          "id": "1",
          "real_name": "kibe-san",
          "url": "https://docs.kibe.la/@kibe"
        },
        "id": "1",
        "url": "https://docs.kibe.la/@kibe/1#comment_1"
      }
    ],
    "id": "1",
    "title": "sample request",
    "url": "https://docs.kibe.la/@kibe/1"
  },
  "resource_type": "blog",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  }
}

イベント:共同編集が「有効」な記事の投稿

  • resource_type: wiki
  • action: create
  • team: イベントが発生したチーム
  • action_user: 投稿したユーザー
  • wiki: 投稿されたwiki

サンプルリクエスト

POST /payload HTTP/1.1

Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "create",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "resource_type": "wiki",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  },
  "wiki": {
    "authors": [
      {
        "account": "kibe",
        "avatar_photo": {
          "url": "https://cdn.kibe.la/media/public/1/kibe.png"
        },
        "id": "1",
        "real_name": "kibe-san",
        "url": "https://docs.kibe.la/@kibe"
      }
    ],
    "boards": [
      {
        "id": "1",
        "name": "Product Team"
      }
    ],
    "content_html": "<h2>sample request</h2>",
    "content_md": "## sample request",
    "id": "1",
    "title": "sample request",
    "url": "https://docs.kibe.la/wikis/sample_request/1"
  }
}

イベント: 共同編集が「有効」な記事の更新

  • resource_type: wiki
  • action: update
  • team: イベントが発生したチーム
  • action_user: 更新したユーザー
  • wiki: 更新されたwiki

サンプルリクエスト

POST /payload HTTP/1.1

Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "update",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "notify": true, # 廃止された"更新を知らせる"機能用のパラメータ
  "resource_type": "wiki",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  },
  "wiki": {
    "authors": [
      {
        "account": "kibe",
        "avatar_photo": {
          "url": "https://cdn.kibe.la/media/public/1/kibe.png"
        },
        "id": "1",
        "real_name": "kibe-san",
        "url": "https://docs.kibe.la/@kibe"
      }
    ],
    "boards": [
      {
        "id": "1",
        "name": "Product Team"
      }
    ],
    "content_html": "<h2>sample request</h2>",
    "content_md": "## sample request",
    "content_diff": "+sample request\n-[WIP]sample request",
    "revision_url": "https://docs.kibe.la/wikis/1/versions/1",
    "id": "1",
    "title": "sample request",
    "url": "https://docs.kibe.la/wikis/sample_request/1"
  }
}

イベント: 共同編集が「有効」な記事の削除

  • resource_type: wiki
  • action: delete
  • team: イベントが発生したチーム
  • action_user: 削除したユーザー
  • wiki: 削除された共wiki

サンプルリクエスト

POST /payload HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "delete",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "resource_type": "wiki",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  },
  "wiki": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "boards": [
      {
        "id": "1",
        "name": "Product Team"
      }
    ],
    "comments": [
      {
        "author": {
          "account": "kibe",
          "avatar_photo": {
            "url": "https://cdn.kibe.la/media/public/1/kibe.png"
          },
          "id": "1",
          "real_name": "kibe-san",
          "url": "https://docs.kibe.la/@kibe"
        },
        "id": "1",
        "url": "https://docs.kibe.la/@kibe/1#comment_1"
      }
    ],
    "id": "1",
    "title": "sample request",
    "url": "https://docs.kibe.la/wikis/sample_request/1"
  }
}

イベント: コメントの投稿

  • resource_type: comment
  • action: create
  • team: イベントが発生したチーム
  • action_user: 投稿したユーザー
  • comment: 投稿されたコメント

※サンプルリクエストをご覧の際の注意点※

blog、wiki は、記事の共同編集の設定によって項目名が変化します。
記事の共同編集が有効の場合はwikiに、共同編集が無効の場合はblogになります。

サンプルリクエスト

POST /payload HTTP/1.1

Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "create",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "comment": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "blog": {
      "author": {
        "account": "kibe",
        "avatar_photo": {
          "url": "https://cdn.kibe.la/media/public/1/kibe.png"
        },
        "id": "1",
        "real_name": "kibe-san",
        "url": "https://docs.kibe.la/@kibe"
      },
      "boards": [
        {
          "id": "1",
          "name": "Product Team"
        }
      ],
      "content_html": "<h2>sample request</h2>",
      "content_md": "## sample request",
      "id": "1",
      "title": "sample request",
      "url": "https://docs.kibe.la/@kibe/1"
    },
    "content_html": "<h2>sample request</h2>",
    "content_md": "## sample request",
    "id": "1",
    "url": "https://docs.kibe.la/@kibe/1#comment_1"
  },
  "resource_type": "comment",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  }
}

イベント: コメントの更新

  • resource_type: comment
  • action: update
  • team: イベントが発生したチーム
  • action_user: 更新したユーザー
  • comment: 更新されたコメント

サンプルリクエスト

POST /payload HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "update",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "comment": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "blog": {
      "author": {
        "account": "kibe",
        "avatar_photo": {
          "url": "https://cdn.kibe.la/media/public/1/kibe.png"
        },
        "id": "1",
        "real_name": "kibe-san",
        "url": "https://docs.kibe.la/@kibe"
      },
      "boards": [
        {
          "id": "1",
          "name": "Product Team"
        }
      ],
      "content_html": "<h2>sample request</h2>",
      "content_md": "## sample request",
      "id": "1",
      "title": "sample request",
      "url": "https://docs.kibe.la/@kibe/1"
    },
    "content_html": "<h2>sample request</h2>",
    "content_md": "## sample request",
    "id": "1",
    "url": "https://docs.kibe.la/@kibe/1#comment_1"
  },
  "resource_type": "comment",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  }
}

イベント: コメントの削除

  • resource_type: comment
  • action: delete
  • team: イベントが発生したチーム
  • action_user: 削除したユーザー
  • comment: 削除されたコメント

サンプルリクエスト

POST /payload HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
  "action": "delete",
  "action_user": {
    "account": "kibe",
    "avatar_photo": {
      "url": "https://cdn.kibe.la/media/public/1/kibe.png"
    },
    "id": "1",
    "real_name": "kibe-san",
    "url": "https://docs.kibe.la/@kibe"
  },
  "comment": {
    "author": {
      "account": "kibe",
      "avatar_photo": {
        "url": "https://cdn.kibe.la/media/public/1/kibe.png"
      },
      "id": "1",
      "real_name": "kibe-san",
      "url": "https://docs.kibe.la/@kibe"
    },
    "blog": {
      "author": {
        "account": "kibe",
        "avatar_photo": {
          "url": "https://cdn.kibe.la/media/public/1/kibe.png"
        },
        "id": "1",
        "real_name": "kibe-san",
        "url": "https://docs.kibe.la/@kibe"
      },
      "boards": [
        {
          "id": "1",
          "name": "Product Team"
        }
      ],
      "content_html": "<h2>sample request</h2>",
      "content_md": "## sample request",
      "id": "1",
      "title": "sample request",
      "url": "https://docs.kibe.la/@kibe/1"
    },
    "id": "1",
    "url": "https://docs.kibe.la/@kibe/1#comment_1"
  },
  "resource_type": "comment",
  "team": {
    "name": "docs",
    "url": "https://docs.kibe.la"
  }
}

イベント:コメント返信の投稿

  • resource_type: comment_reply
  • action: create
  • team: イベントが発生したチーム
  • action_user: 投稿したユーザー
  • comment_reply: 投稿されたコメント返信

※サンプルリクエストをご覧の際の注意点※

blog、wiki は、記事の共同編集の設定によって項目名が変化します。
記事の共同編集が有効の場合はwikiに、共同編集が無効の場合はblogになります。

サンプルリクエスト

POST /payload HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
"team": {
"name": "docs",
"url": "https://docs.kibe.la/"
},
"resource_type": "comment_reply",
"action": "create",
"action_user": {
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
},
"comment_reply": {
"id": 10,
"url": "https://docs.kibe.la/notes/1262#comment_reply_10",
"content_md": "## sample request",
"content_html": "<h2>sample request</h2>",
"author": {
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
},
"wiki": {
"id": 1262,
"url": "https://docs.kibe.la/notes/1262",
"title": "sample request",
"content_md": "## sample request",
"content_html": "<h2>sample request</h2>",
"boards": [
{
"id": 1,
"name": "Home"
}
],
"authors": [
{
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
}
]
}
}
}

イベント:コメント返信の更新

  • resource_type: comment_reply
  • action: update
  • team: イベントが発生したチーム
  • action_user: 投稿したユーザー
  • comment_reply: 投稿されたコメント返信

サンプルリクエスト

POST /payload HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
"team": {
"name": "docs",
"url": "https://docs.kibe.la/"
},
"resource_type": "comment_reply",
"action": "update",
"action_user": {
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
},
"comment_reply": {
"id": 10,
"url": "https://docs.kibe.la/notes/1262#comment_reply_10",
"content_md": "## sample request",
"content_html": "<h2>sample request</h2>",
"author": {
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
},
"wiki": {
"id": 1262,
"url": "https://docs.kibe.la/notes/1262",
"title": "sample request",
"content_md": "## sample request",
"content_html": "<h2>sample request</h2>",
"boards": [
{
"id": 1,
"name": "Home"
}
],
"authors": [
{
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
}
]
}
}
}

イベント:コメント返信の削除

  • resource_type: comment_reply
  • action: delete
  • team: イベントが発生したチーム
  • action_user: 投稿したユーザー
  • comment_reply: 投稿されたコメント返信

サンプルリクエスト 

POST /payload HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 1000
User-Agent: Kibela-Hookshot/v1

{
"team": {
"name": "docs",
"url": "https://docs.kibe.la/"
},
"resource_type": "comment_reply",
"action": "delete",
"action_user": {
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
},
"comment_reply": {
"id": 10,
"url": "https://docs.kibe.la/notes/1262#comment_reply_10",
"author": {
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
},
"wiki": {
"id": 1262,
"url": "https://docs.kibe.la/notes/1262",
"title": "sample request",
"content_md": "## sample request",
"content_html": "<h2>sample request</h2>",
"boards": [
{
"id": 1,
"name": "Home"
}
],
"authors": [
{
"id": 1,
"account": "kibe",
"real_name": "kibe-san",
"url": "https://docs.kibe.la/@kibe",
"avatar_photo": {
"url": "https://cdn.kibe.la/media/public/1/kibe.png"
}
}
]
}
}
}