データソースプラグインリストを取得
ナレッジパイプラインに設定されたデータソースノードを、それぞれが使用するプラグインとノードの実行に必要なメタデータとともに返します。
curl --request GET \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"credentials": [
{
"id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"is_default": true,
"name": "Production Notion",
"type": "api-key"
}
],
"datasource_type": "online_document",
"node_id": "1719288585006",
"plugin_id": "langgenius/notion_datasource",
"provider_name": "notion",
"title": "Notion Documents",
"user_input_variables": []
}
]Authorizations
すべてのリクエストは API キーで認証します:Authorization: Bearer {API_KEY}。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します(Dify API クイックスタート)。
キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP 401(unauthorized)で失敗します。
Path Parameters
ナレッジベース ID。ナレッジベースリストを取得 で取得します。スコープを限定したキーでは、Dify の URL から ID をコピー してください。
Query Parameters
ドラフトではなく公開済みパイプラインバージョンからノードを読み取るかどうかを指定します。
Response
パイプラインに設定されているデータソースノードのリストです。
このデータソースの認証に利用できる資格情報のリストです。
Show child attributes
Show child attributes
データソースのタイプです。local_file、online_document、online_drive、website_crawl のいずれかです。
パイプラインワークフロー内のデータソースノードの ID です。 データソースノードを実行 では node_id として、 パイプラインを実行 では start_node_id として渡します。
このノードを提供するデータソースプラグインの ID です。
データソースプラグインが登録するプロバイダー名です。
ノードに設定されている表示タイトルです。
このデータソースに対して呼び出し元が指定するパイプライン入力変数です。ノードのデータソースパラメータ内の {{#...#}} 参照から導出されます。各要素はワークフローが使用するパイプライン変数のスキーマに従います。
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/datasets/{dataset_id}/pipeline/datasource-plugins")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"credentials": [
{
"id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"is_default": true,
"name": "Production Notion",
"type": "api-key"
}
],
"datasource_type": "online_document",
"node_id": "1719288585006",
"plugin_id": "langgenius/notion_datasource",
"provider_name": "notion",
"title": "Notion Documents",
"user_input_variables": []
}
]