# 导入知识库节点

文档API使用须知

# host: https://yach-oapi.zhiyinlou.com 正式环境

# host: https://yach-oapi-test.zhiyinlou.com 测试环境

# 概述

名称
地址 /openapi/v2/lore/import/async
请求方式 POST
参数 见【参数】
返回值 见【返回值】
名称
Content-Type application/json

# 参数

参数 参数类型 必须 说明
access_token String 调用接口凭证
space_id Integer 知识库ID,和space_url二选一
space_url String 知识库url,和space_id二选一
parent_node_id String 导入父节点ID,和parent_node_url二选一
parent_node_url String 导入父节点url,和parent_node_id二选一
node_type String 导入的文档类型,需要和file_url类型匹配,否则获取不到导入进度 ,文档支持:txt、md、doc、docx,表格支持:csv、xls、xlsx,幻灯片支持:ppt、pptx,脑图支持:xmind,如果是离线文件上传,写固定值 file
title String 文件名称,如果是导入文档,则名称中要包含后缀,比如xxx.docx
file_url String 导入文件的地址

示例:

{
  "access_token":"xxxxx",
  "space_url":"https://s.tal.com/a/xxxxx",
  "parent_node_url":"https://s.tal.com/a/xxxxx",
  "node_type":"txt",
  "title":"我是标题.txt",
  "file_url":"xxxxxx"
}

返回值(响应从的 200为成功,非200为不成功)

{
  "code":200,
  "msg":"success",
  "obj":{
    "task_id":"xxxxxxx"
  }
}
foo