Skip to main content
post/knowledge-fs/spaces/{knowledge_base_id}/sources/{source_id}/test
Request example
Response
post/knowledge-fs/spaces/{knowledge_base_id}/sources/{source_id}/test

Authorization

Authorizationstringheaderrequired#

每个请求都通过 API Key 认证:Authorization: Bearer {API_KEY}。应用接口使用应用 API Key,知识库接口使用知识库 API Key(快速开始)。

API Key 应保存在服务端,切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP 401(unauthorized)。

Path parameters

knowledge_base_idstringrequired#
知识库 ID:即知识库 API 访问 对话框中所示服务 API 端点的最后一段(…/knowledge-fs/spaces/<knowledge base ID>),也是地址栏中 /datasets/new/ 之后的那一段。
source_idstringrequired#
数据源 ID,通过 获取数据源列表 获取。

Responses

application/json
测试结果。凭据被拒绝时返回 200,带有 valid: false 和错误详情。
codestring#
valid 为 false 时为 failure.code,否则为 null。此处的 SOURCE_CREDENTIAL_TEST_FAILED 表示提供商拒绝了凭据。
errorstring#
valid 为 false 时为 failure.message,否则为 null。文本按失败的 category 或 code 固定,从不包含提供商自己给出的原因。
failureobject#
valid 为 false 时的错误详情;提供商未给出原因时为 null。valid 为 true 时为 null。stage 为 credential-test。
validboolean#
提供商接受凭据时为 true。