Skip to content

Commit 3b31804

Browse files
app doc (#5712)
* app doc * app doc --------- Co-authored-by: heheer <[email protected]>
1 parent 93e260e commit 3b31804

File tree

6 files changed

+203
-6
lines changed

6 files changed

+203
-6
lines changed
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
---
2+
title: 应用接口
3+
description: FastGPT OpenAPI 应用接口
4+
---
5+
6+
## 前置准备
7+
8+
1. 准备 API key: 可用直接使用全局 apikey
9+
2. 准备应用的 AppId
10+
11+
![alt text](/imgs/image-120.png)
12+
13+
14+
## 日志接口
15+
16+
### 获取累积运行结果
17+
18+
<Tabs items={["请求示例","响应示例","参数说明"]}>
19+
20+
<Tab value="请求示例">
21+
22+
```bash
23+
curl --location --request GET 'https://cloud.fastgpt.cn/api/proApi/core/app/logs/getTotalData?appId=68c46a70d950e8850ae564ba' \
24+
--header 'Authorization: Bearer apikey'
25+
```
26+
27+
</Tab>
28+
29+
<Tab value="响应示例">
30+
31+
```bash
32+
{
33+
"code": 200,
34+
"statusText": "",
35+
"message": "",
36+
"data": {
37+
"totalUsers": 0,
38+
"totalChats": 0,
39+
"totalPoints": 0
40+
}
41+
}
42+
```
43+
44+
</Tab>
45+
46+
<Tab value="参数说明">
47+
48+
<div>
49+
**入参:**
50+
- appId: 应用Id
51+
52+
**出参:**
53+
- totalUsers: 累积使用用户数量
54+
- totalChats: 累积对话数量
55+
- totalPoints: 累积积分消耗
56+
</div>
57+
58+
</Tab>
59+
60+
</Tabs>
61+
62+
### 获取应用日志看板
63+
64+
<Tabs items={["请求示例","响应示例","参数说明"]}>
65+
66+
<Tab value="请求示例">
67+
68+
```bash
69+
curl --location --request POST 'https://cloud.fastgpt.cn/api/proApi/core/app/logs/getChartData' \
70+
--header 'Authorization: Bearer apikey' \
71+
--header 'Content-Type: application/json' \
72+
--data-raw '{
73+
"appId": "68c46a70d950e8850ae564ba",
74+
"dateStart": "2025-09-19T16:00:00.000Z",
75+
"dateEnd": "2025-09-27T15:59:59.999Z",
76+
"offset": 1,
77+
"source": [
78+
"test",
79+
"online",
80+
"share",
81+
"api",
82+
"cronJob",
83+
"team",
84+
"feishu",
85+
"official_account",
86+
"wecom",
87+
"mcp"
88+
],
89+
"userTimespan": "day",
90+
"chatTimespan": "day",
91+
"appTimespan": "day"
92+
}'
93+
```
94+
95+
</Tab>
96+
97+
<Tab value="响应示例">
98+
99+
```bash
100+
{
101+
"code": 200,
102+
"statusText": "",
103+
"message": "",
104+
"data": {
105+
"userData": [
106+
{
107+
"timestamp": 1758585600000,
108+
"summary": {
109+
"userCount": 1,
110+
"newUserCount": 0,
111+
"retentionUserCount": 0,
112+
"points": 1.1132600000000001,
113+
"sourceCountMap": {
114+
"test": 1,
115+
"online": 0,
116+
"share": 0,
117+
"api": 0,
118+
"cronJob": 0,
119+
"team": 0,
120+
"feishu": 0,
121+
"official_account": 0,
122+
"wecom": 0,
123+
"mcp": 0
124+
}
125+
}
126+
}
127+
],
128+
"chatData": [
129+
{
130+
"timestamp": 1758585600000,
131+
"summary": {
132+
"chatItemCount": 1,
133+
"chatCount": 1,
134+
"errorCount": 0,
135+
"points": 1.1132600000000001
136+
}
137+
}
138+
],
139+
"appData": [
140+
{
141+
"timestamp": 1758585600000,
142+
"summary": {
143+
"goodFeedBackCount": 0,
144+
"badFeedBackCount": 0,
145+
"chatCount": 1,
146+
"totalResponseTime": 22.31
147+
}
148+
}
149+
]
150+
}
151+
}
152+
```
153+
154+
</Tab>
155+
156+
<Tab value="参数说明">
157+
158+
**入参:**
159+
- appId: 应用Id
160+
- dateStart: 开始时间
161+
- dateEnd: 结束时间
162+
- source: 日志来源
163+
- offset: 用户留存偏移量
164+
- userTimespan: 用户数据时间跨度 //day|week|month|quarter
165+
- chatTimespan: 对话数据时间跨度 //day|week|month|quarter
166+
- appTimespan: 应用数据时间跨度 //day|week|month|quarter
167+
168+
**出参:**
169+
170+
- userData: 用户数据数组
171+
- timestamp: 时间戳
172+
- summary: 汇总数据对象
173+
- userCount: 活跃用户数量
174+
- newUserCount: 新用户数量
175+
- retentionUserCount: 留存用户数量
176+
- points: 总积分消耗
177+
- sourceCountMap: 各来源用户数量
178+
- chatData: 对话数据数组
179+
- timestamp: 时间戳
180+
- summary: 汇总数据对象
181+
- chatItemCount: 对话次数
182+
- chatCount - 会话次数
183+
- errorCount - 错误对话次数
184+
- points - 总积分消耗
185+
- appData: 应用数据数组
186+
- timestamp - 时间戳
187+
- summary - 汇总数据对象
188+
- goodFeedBackCount - 好评反馈数量
189+
- badFeedBackCount - 差评反馈数量
190+
- chatCount - 对话次数
191+
- totalResponseTime - 总响应时间
192+
193+
</Tab>
194+
195+
</Tabs>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"title": "OpenAPI接口文档",
3-
"pages": ["intro","chat","dataset","share"]
4-
}
3+
"pages": ["intro", "app", "chat", "dataset", "share"]
4+
}

document/content/docs/toc.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ description: FastGPT 文档目录
3434
- [/docs/introduction/development/modelConfig/one-api](/docs/introduction/development/modelConfig/one-api)
3535
- [/docs/introduction/development/modelConfig/ppio](/docs/introduction/development/modelConfig/ppio)
3636
- [/docs/introduction/development/modelConfig/siliconCloud](/docs/introduction/development/modelConfig/siliconCloud)
37+
- [/docs/introduction/development/openapi/app](/docs/introduction/development/openapi/app)
3738
- [/docs/introduction/development/openapi/chat](/docs/introduction/development/openapi/chat)
3839
- [/docs/introduction/development/openapi/dataset](/docs/introduction/development/openapi/dataset)
3940
- [/docs/introduction/development/openapi/intro](/docs/introduction/development/openapi/intro)

document/data/doc-last-modified.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"document/content/docs/introduction/development/modelConfig/one-api.mdx": "2025-07-23T21:35:03+08:00",
3232
"document/content/docs/introduction/development/modelConfig/ppio.mdx": "2025-08-05T23:20:39+08:00",
3333
"document/content/docs/introduction/development/modelConfig/siliconCloud.mdx": "2025-08-05T23:20:39+08:00",
34+
"document/content/docs/introduction/development/openapi/app.mdx": "2025-09-26T11:31:49+08:00",
3435
"document/content/docs/introduction/development/openapi/chat.mdx": "2025-08-14T18:54:47+08:00",
3536
"document/content/docs/introduction/development/openapi/dataset.mdx": "2025-09-15T20:02:54+08:00",
3637
"document/content/docs/introduction/development/openapi/intro.mdx": "2025-08-14T18:54:47+08:00",
@@ -87,7 +88,7 @@
8788
"document/content/docs/introduction/guide/plugins/doc2x_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
8889
"document/content/docs/introduction/guide/plugins/google_search_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
8990
"document/content/docs/introduction/guide/plugins/searxng_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
90-
"document/content/docs/introduction/guide/plugins/upload_system_tool.mdx": "2025-09-20T19:49:21+08:00",
91+
"document/content/docs/introduction/guide/plugins/upload_system_tool.mdx": "2025-09-24T22:40:31+08:00",
9192
"document/content/docs/introduction/guide/team_permissions/invitation_link.mdx": "2025-07-23T21:35:03+08:00",
9293
"document/content/docs/introduction/guide/team_permissions/team_roles_permissions.mdx": "2025-07-23T21:35:03+08:00",
9394
"document/content/docs/introduction/index.en.mdx": "2025-07-23T21:35:03+08:00",
@@ -100,7 +101,7 @@
100101
"document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00",
101102
"document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00",
102103
"document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00",
103-
"document/content/docs/toc.mdx": "2025-09-23T14:19:37+08:00",
104+
"document/content/docs/toc.mdx": "2025-09-26T11:31:49+08:00",
104105
"document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00",
105106
"document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00",
106107
"document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00",
@@ -110,7 +111,7 @@
110111
"document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00",
111112
"document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00",
112113
"document/content/docs/upgrading/4-12/4124.mdx": "2025-09-17T22:29:56+08:00",
113-
"document/content/docs/upgrading/4-13/4130.mdx": "2025-09-24T21:54:28+08:00",
114+
"document/content/docs/upgrading/4-13/4130.mdx": "2025-09-24T22:40:31+08:00",
114115
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
115116
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
116117
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",

document/public/imgs/image-120.png

526 KB
Loading

projects/app/src/pages/api/admin/initv4124.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type SyncAppChatLogBody = {
1717
export type SyncAppChatLogResponse = {};
1818

1919
/**
20-
* 初始化脚本 v4.13.0
20+
* 初始化脚本 v4.12.4
2121
* 对系统内所有资源 App 和 dataset 添加 tmbId 为自己 owner 的协作者,权限为 OwnerRoleVal
2222
*/
2323
async function handler(

0 commit comments

Comments
 (0)