如何接入Confluence文档
更新时间:2024-12-10
Confluence是一个由Atlassian开发的企业级协作软件,旨在帮助团队和组织创建、共享和管理知识。它提供了一个集中的平台,用于文档的创建、编辑和组织,并且支持团队成员之间的实时协作和沟通。
操作流程介绍
接口demo
提供iapi、postman、swagger等方式的接口连接,下载后即可请求使用。
接口定义
测试连接
POST /kmss/openapi/confluence/connector/testConnect
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
Accept | header | string | 是 | application/json |
token | header | string | 是 | ca0940941245f4701190b2fa2e4bf0e4 |
userid | header | string | 是 | 获取方法:登录百度智能云,进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云,进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云,进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
body | body | object | 是 | none |
» username | body | string | 是 | none |
» password | body | string | 是 | none |
» url | body | string | 是 | none |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": "vdtA7edSZj"
5}
Plain Text
1{
2 "errno": -1,
3 "msg": "重复创建"
4}
Plain Text
1{
2 "errno": -1,
3 "msg": "连接失败"
4}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 说明 |
---|---|---|
» errno | integer | 正常返回0,失败返回-1 |
» msg | string | 报错信息 |
» data | integer | 调用「任务注册」接口需要传递的channelId字段 |
获取空间列表
GET /kmss/openapi/confluence/connector/getSpaceList
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
channelId | query | string | 是 | 「测试链接」接口返回的data内容 |
Accept | header | string | 是 | application/json |
token | header | string | 是 | 09e152dcdad60d7041f60b370e89e466 |
userid | header | string | 是 | 获取方法:1. 登录百度智能云;2. 进入甄知首页,打开浏览器检查,定位到/user/current接口![]() ![]() |
accountid | header | string | 是 | 获取方法:1. 登录百度智能云;2. 进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:1. 登录百度智能云;2. 进入甄知首页,打开浏览器检查,定位到/user/current接口![]() ![]() |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": [
5 {
6 "id": 131073,
7 "key": "ds",
8 "name": "Demonstration Space",
9 "type": "global",
10 "_links": {
11 "webui": "/display/ds",
12 "self": "http://confluence.com:8090/rest/api/space/ds"
13 },
14 "_expandable": {
15 "metadata": "",
16 "icon": "",
17 "description": "",
18 "retentionPolicy": "",
19 "homepage": "/rest/api/content/98319"
20 }
21 },
22 {
23 "id": 131076,
24 "key": "test02",
25 "name": "智能创作",
26 "type": "global",
27 "_links": {
28 "webui": "/display/test02",
29 "self": "http://confluence.com:8090/rest/api/space/test02"
30 },
31 "_expandable": {
32 "metadata": "",
33 "icon": "",
34 "description": "",
35 "retentionPolicy": "",
36 "homepage": "/rest/api/content/98394"
37 }
38 },
39 {
40 "id": 131074,
41 "key": "SPC",
42 "name": "测试空间",
43 "type": "global",
44 "_links": {
45 "webui": "/display/SPC",
46 "self": "http://confluence.com:8090/rest/api/space/SPC"
47 },
48 "_expandable": {
49 "metadata": "",
50 "icon": "",
51 "description": "",
52 "retentionPolicy": "",
53 "homepage": "/rest/api/content/98361"
54 }
55 },
56 {
57 "id": 131075,
58 "key": "test01",
59 "name": "链接器空间",
60 "type": "global",
61 "_links": {
62 "webui": "/display/test01",
63 "self": "http://confluence.com:8090/rest/api/space/test01"
64 },
65 "_expandable": {
66 "metadata": "",
67 "icon": "",
68 "description": "",
69 "retentionPolicy": "",
70 "homepage": "/rest/api/content/98378"
71 }
72 }
73 ]
74}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 说明 |
---|---|---|---|
» errno | integer | true | 错误码 |
» msg | string | true | |
» data | [object] | true | |
»» id | integer | true | |
»» key | string | true | 重点关注字段,「注册任务」接口需要传递的spaceKey |
»» name | string | true | |
»» type | string | true | |
»» _links | object | true | |
»»» webui | string | true | |
»»» self | string | true | |
»» _expandable | object | true | |
»»» metadata | string | true | |
»»» icon | string | true | |
»»» description | string | true | |
»»» retentionPolicy | string | true | |
»»» homepage | string | true |
重试
GET /kmss/openapi/confluence/connector/pushDataByFileId
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
taskId | query | string | 是 | 「注册任务」接口返回的id信息 |
fileId | query | string | 是 | 原始系统中的文档id |
Accept | header | string | 是 | application/json |
token | header | string | 是 | 6cf13f931f1acb8840bb03116a0f799f |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": 1
5}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 说明 |
---|---|---|
» errno | integer | |
» msg | string | |
» data | integer |
注册任务
POST /kmss/openapi/data/connector/addTask
Body 请求参数
Plain Text
1{
2 "items": [
3 {
4 "source": "7379125463078289412",
5 "channelId": "MWATe2ywyw",
6 "taskType": "confluence",
7 "spaceGuid": "o6sNkygHVu"
8 }
9 ]
10}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
Accept | header | string | 是 | application/json |
token | header | string | 是 | b18e4376fb3ea907e209fc4c50759915 |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
body | body | object | 是 | none |
» items | body | [object] | 是 | none |
»» source | body | string | 是 | none |
»» channelId | body | integer | 是 | none |
»» taskType | body | string | 是 | none |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": [
5 {
6 "test02": "Haez5MRf7Z"
7 }
8 ]
9}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» errno | integer | true | none | none | |
» msg | string | true | none | none | |
» data | [object] | true | none | none | |
»»source | string | false | none | none |
任务信息
GET /kmss/openapi/data/connector/taskInfo
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | query | string | 是 | 注册任务时返回的任务id |
Accept | header | string | 是 | application/json |
token | header | string | 是 | 5abeb6c1fadcbf0488d0a6e583b3803b |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": {
5 "id": "3xxHRPwcCZ",
6 "source": "test01",
7 "originalTotal": 3,
8 "total": 3,
9 "status": 50,
10 "createTime": "2024-06-21 23:43:15",
11 "updateTime": "2024-06-22 00:02:42",
12 "channelId": "RSmaY8sRgj",
13 "type": "confluence",
14 "host": "http://xxx.xxx.com:8090",
15 "auth": "Basic YWRtaW46emhlbnpoaTAwMUBBYmM=",
16 "spaceGuid": "o6sNkygHVu",
17 "errMsg": null,
18 "extFields": {}
19 }
20}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» errno | integer | true | none | none | |
» msg | string | true | none | none | |
» data | object | true | none | none | |
»» id | string | true | none | none | |
»» source | string | true | none | none | |
»» originalTotal | integer | true | none | none | |
»» total | integer | true | none | none | |
»» status | integer | true | none | none | |
»» createTime | string | true | none | none | |
»» updateTime | string | true | none | none | |
»» channelId | string | true | none | none | |
»» type | string | true | none | none | |
»» host | string | true | none | none | |
»» auth | string | true | none | none | |
»» spaceGuid | string | true | none | none | |
»» errMsg | null | true | none | none | |
»» extFields | object | true | none | none |
触发任务
GET /kmss/openapi/data/connector/triggerTask
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | query | string | 是 | 任务id |
spaceguid | query | string | 是 | 租户id |
Accept | header | string | 是 | application/json |
token | header | string | 是 | b25a91326f3ee2efa5b7e993b6e773d1 |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": "3xxHRPwcCZ"
5}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» errno | integer | true | none | none | |
» msg | string | true | none | none | |
» data | string | true | none | none |
定时任务启动
全局生效,如果接入多数据源只需要触发一次
POST /kmss/openapi/data/connector/task/start
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
Accept | header | string | 是 | application/json |
token | header | string | 是 | 3cb65c0d5224291d2a5affcdc71a8d48 |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": "定时任务启动成功"
5}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» errno | integer | true | none | none | |
» msg | string | true | none | none | |
» data | string | true | none | none |