mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 15:10:13 -05:00
feat: Service API - add end-user lookup endpoint (#32015)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -273,6 +273,71 @@ The text generation application offers non-session support and is ideal for tran
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='Get End User'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
Retrieve an end user by ID.
|
||||
|
||||
This is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).
|
||||
|
||||
### Path Parameters
|
||||
- `end_user_id` (uuid) Required
|
||||
End user ID.
|
||||
|
||||
### Response
|
||||
Returns an EndUser object.
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) Tenant ID
|
||||
- `app_id` (uuid) App ID
|
||||
- `type` (string) End user type
|
||||
- `external_user_id` (string) External user ID
|
||||
- `name` (string) Name
|
||||
- `is_anonymous` (boolean) Whether anonymous
|
||||
- `session_id` (string) Session ID
|
||||
- `created_at` (string) ISO 8601 datetime
|
||||
- `updated_at` (string) ISO 8601 datetime
|
||||
|
||||
### Errors
|
||||
- 404, `end_user_not_found`, end user not found
|
||||
- 500, internal server error
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### Request Example
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### Response Example
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -272,6 +272,71 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='エンドユーザーを取得'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
エンドユーザー ID からエンドユーザー情報を取得します。
|
||||
|
||||
他の API がエンドユーザー ID(例:ファイルアップロードの `created_by`)を返す場合に利用できます。
|
||||
|
||||
### パスパラメータ
|
||||
- `end_user_id` (uuid) 必須
|
||||
エンドユーザー ID。
|
||||
|
||||
### レスポンス
|
||||
EndUser オブジェクトを返します。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) テナント ID
|
||||
- `app_id` (uuid) アプリ ID
|
||||
- `type` (string) エンドユーザー種別
|
||||
- `external_user_id` (string) 外部ユーザー ID
|
||||
- `name` (string) 名前
|
||||
- `is_anonymous` (boolean) 匿名ユーザーかどうか
|
||||
- `session_id` (string) セッション ID
|
||||
- `created_at` (string) ISO 8601 日時
|
||||
- `updated_at` (string) ISO 8601 日時
|
||||
|
||||
### エラー
|
||||
- 404, `end_user_not_found`, エンドユーザーが見つかりません
|
||||
- 500, 内部サーバーエラー
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### リクエスト例
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### レスポンス例
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -249,6 +249,69 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='获取终端用户'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
通过终端用户 ID 获取终端用户信息。
|
||||
|
||||
当其他 API 返回终端用户 ID(例如:上传文件接口返回的 `created_by`)时,可使用该接口查询对应的终端用户信息。
|
||||
|
||||
### 路径参数
|
||||
- `end_user_id` (uuid) 必需
|
||||
终端用户 ID。
|
||||
|
||||
### Response
|
||||
返回 EndUser 对象。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) 工作空间(Tenant)ID
|
||||
- `app_id` (uuid) 应用 ID
|
||||
- `type` (string) 终端用户类型
|
||||
- `external_user_id` (string) 外部用户 ID
|
||||
- `name` (string) 名称
|
||||
- `is_anonymous` (boolean) 是否匿名
|
||||
- `session_id` (string) 会话 ID
|
||||
- `created_at` (string) ISO 8601 时间
|
||||
- `updated_at` (string) ISO 8601 时间
|
||||
|
||||
### Errors
|
||||
- 404,`end_user_not_found`,终端用户不存在
|
||||
- 500,内部服务器错误
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -392,6 +392,71 @@ Chat applications support session persistence, allowing previous chat history to
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='Get End User'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
Retrieve an end user by ID.
|
||||
|
||||
This is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).
|
||||
|
||||
### Path Parameters
|
||||
- `end_user_id` (uuid) Required
|
||||
End user ID.
|
||||
|
||||
### Response
|
||||
Returns an EndUser object.
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) Tenant ID
|
||||
- `app_id` (uuid) App ID
|
||||
- `type` (string) End user type
|
||||
- `external_user_id` (string) External user ID
|
||||
- `name` (string) Name
|
||||
- `is_anonymous` (boolean) Whether anonymous
|
||||
- `session_id` (string) Session ID
|
||||
- `created_at` (string) ISO 8601 datetime
|
||||
- `updated_at` (string) ISO 8601 datetime
|
||||
|
||||
### Errors
|
||||
- 404, `end_user_not_found`, end user not found
|
||||
- 500, internal server error
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### Request Example
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### Response Example
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -393,6 +393,71 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='エンドユーザーを取得'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
エンドユーザー ID からエンドユーザー情報を取得します。
|
||||
|
||||
他の API がエンドユーザー ID(例:ファイルアップロードの `created_by`)を返す場合に利用できます。
|
||||
|
||||
### パスパラメータ
|
||||
- `end_user_id` (uuid) 必須
|
||||
エンドユーザー ID。
|
||||
|
||||
### レスポンス
|
||||
EndUser オブジェクトを返します。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) テナント ID
|
||||
- `app_id` (uuid) アプリ ID
|
||||
- `type` (string) エンドユーザー種別
|
||||
- `external_user_id` (string) 外部ユーザー ID
|
||||
- `name` (string) 名前
|
||||
- `is_anonymous` (boolean) 匿名ユーザーかどうか
|
||||
- `session_id` (string) セッション ID
|
||||
- `created_at` (string) ISO 8601 日時
|
||||
- `updated_at` (string) ISO 8601 日時
|
||||
|
||||
### エラー
|
||||
- 404, `end_user_not_found`, エンドユーザーが見つかりません
|
||||
- 500, 内部サーバーエラー
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### リクエスト例
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### レスポンス例
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -390,6 +390,69 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='获取终端用户'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
通过终端用户 ID 获取终端用户信息。
|
||||
|
||||
当其他 API 返回终端用户 ID(例如:上传文件接口返回的 `created_by`)时,可使用该接口查询对应的终端用户信息。
|
||||
|
||||
### 路径参数
|
||||
- `end_user_id` (uuid) 必需
|
||||
终端用户 ID。
|
||||
|
||||
### Response
|
||||
返回 EndUser 对象。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) 工作空间(Tenant)ID
|
||||
- `app_id` (uuid) 应用 ID
|
||||
- `type` (string) 终端用户类型
|
||||
- `external_user_id` (string) 外部用户 ID
|
||||
- `name` (string) 名称
|
||||
- `is_anonymous` (boolean) 是否匿名
|
||||
- `session_id` (string) 会话 ID
|
||||
- `created_at` (string) ISO 8601 时间
|
||||
- `updated_at` (string) ISO 8601 时间
|
||||
|
||||
### Errors
|
||||
- 404,`end_user_not_found`,终端用户不存在
|
||||
- 500,内部服务器错误
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -362,6 +362,71 @@ Chat applications support session persistence, allowing previous chat history to
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='Get End User'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
Retrieve an end user by ID.
|
||||
|
||||
This is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).
|
||||
|
||||
### Path Parameters
|
||||
- `end_user_id` (uuid) Required
|
||||
End user ID.
|
||||
|
||||
### Response
|
||||
Returns an EndUser object.
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) Tenant ID
|
||||
- `app_id` (uuid) App ID
|
||||
- `type` (string) End user type
|
||||
- `external_user_id` (string) External user ID
|
||||
- `name` (string) Name
|
||||
- `is_anonymous` (boolean) Whether anonymous
|
||||
- `session_id` (string) Session ID
|
||||
- `created_at` (string) ISO 8601 datetime
|
||||
- `updated_at` (string) ISO 8601 datetime
|
||||
|
||||
### Errors
|
||||
- 404, `end_user_not_found`, end user not found
|
||||
- 500, internal server error
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### Request Example
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### Response Example
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -362,6 +362,71 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='エンドユーザーを取得'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
エンドユーザー ID からエンドユーザー情報を取得します。
|
||||
|
||||
他の API がエンドユーザー ID(例:ファイルアップロードの `created_by`)を返す場合に利用できます。
|
||||
|
||||
### パスパラメータ
|
||||
- `end_user_id` (uuid) 必須
|
||||
エンドユーザー ID。
|
||||
|
||||
### レスポンス
|
||||
EndUser オブジェクトを返します。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) テナント ID
|
||||
- `app_id` (uuid) アプリ ID
|
||||
- `type` (string) エンドユーザー種別
|
||||
- `external_user_id` (string) 外部ユーザー ID
|
||||
- `name` (string) 名前
|
||||
- `is_anonymous` (boolean) 匿名ユーザーかどうか
|
||||
- `session_id` (string) セッション ID
|
||||
- `created_at` (string) ISO 8601 日時
|
||||
- `updated_at` (string) ISO 8601 日時
|
||||
|
||||
### エラー
|
||||
- 404, `end_user_not_found`, エンドユーザーが見つかりません
|
||||
- 500, 内部サーバーエラー
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### リクエスト例
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### レスポンス例
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -368,6 +368,69 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='获取终端用户'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
通过终端用户 ID 获取终端用户信息。
|
||||
|
||||
当其他 API 返回终端用户 ID(例如:上传文件接口返回的 `created_by`)时,可使用该接口查询对应的终端用户信息。
|
||||
|
||||
### 路径参数
|
||||
- `end_user_id` (uuid) 必需
|
||||
终端用户 ID。
|
||||
|
||||
### Response
|
||||
返回 EndUser 对象。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) 工作空间(Tenant)ID
|
||||
- `app_id` (uuid) 应用 ID
|
||||
- `type` (string) 终端用户类型
|
||||
- `external_user_id` (string) 外部用户 ID
|
||||
- `name` (string) 名称
|
||||
- `is_anonymous` (boolean) 是否匿名
|
||||
- `session_id` (string) 会话 ID
|
||||
- `created_at` (string) ISO 8601 时间
|
||||
- `updated_at` (string) ISO 8601 时间
|
||||
|
||||
### Errors
|
||||
- 404,`end_user_not_found`,终端用户不存在
|
||||
- 500,内部服务器错误
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/files/:file_id/preview'
|
||||
method='GET'
|
||||
|
||||
@@ -740,6 +740,71 @@ Workflow applications offers non-session support and is ideal for translation, a
|
||||
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='Get End User'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
Retrieve an end user by ID.
|
||||
|
||||
This is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).
|
||||
|
||||
### Path Parameters
|
||||
- `end_user_id` (uuid) Required
|
||||
End user ID.
|
||||
|
||||
### Response
|
||||
Returns an EndUser object.
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) Tenant ID
|
||||
- `app_id` (uuid) App ID
|
||||
- `type` (string) End user type
|
||||
- `external_user_id` (string) External user ID
|
||||
- `name` (string) Name
|
||||
- `is_anonymous` (boolean) Whether anonymous
|
||||
- `session_id` (string) Session ID
|
||||
- `created_at` (string) ISO 8601 datetime
|
||||
- `updated_at` (string) ISO 8601 datetime
|
||||
|
||||
### Errors
|
||||
- 404, `end_user_not_found`, end user not found
|
||||
- 500, internal server error
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### Request Example
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### Response Example
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/workflows/logs'
|
||||
method='GET'
|
||||
|
||||
@@ -736,6 +736,71 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
||||
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='エンドユーザーを取得'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
エンドユーザー ID からエンドユーザー情報を取得します。
|
||||
|
||||
他の API がエンドユーザー ID(例:ファイルアップロードの `created_by`)を返す場合に利用できます。
|
||||
|
||||
### パスパラメータ
|
||||
- `end_user_id` (uuid) 必須
|
||||
エンドユーザー ID。
|
||||
|
||||
### レスポンス
|
||||
EndUser オブジェクトを返します。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) テナント ID
|
||||
- `app_id` (uuid) アプリ ID
|
||||
- `type` (string) エンドユーザー種別
|
||||
- `external_user_id` (string) 外部ユーザー ID
|
||||
- `name` (string) 名前
|
||||
- `is_anonymous` (boolean) 匿名ユーザーかどうか
|
||||
- `session_id` (string) セッション ID
|
||||
- `created_at` (string) ISO 8601 日時
|
||||
- `updated_at` (string) ISO 8601 日時
|
||||
|
||||
### エラー
|
||||
- 404, `end_user_not_found`, エンドユーザーが見つかりません
|
||||
- 500, 内部サーバーエラー
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
### リクエスト例
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
### レスポンス例
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/workflows/logs'
|
||||
method='GET'
|
||||
@@ -1047,4 +1112,3 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
||||
</Col>
|
||||
</Row>
|
||||
___
|
||||
|
||||
|
||||
@@ -727,6 +727,69 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/end-users/:end_user_id'
|
||||
method='GET'
|
||||
title='获取终端用户'
|
||||
name='#end-user'
|
||||
/>
|
||||
<Row>
|
||||
<Col>
|
||||
通过终端用户 ID 获取终端用户信息。
|
||||
|
||||
当其他 API 返回终端用户 ID(例如:上传文件接口返回的 `created_by`)时,可使用该接口查询对应的终端用户信息。
|
||||
|
||||
### 路径参数
|
||||
- `end_user_id` (uuid) 必需
|
||||
终端用户 ID。
|
||||
|
||||
### Response
|
||||
返回 EndUser 对象。
|
||||
- `id` (uuid) ID
|
||||
- `tenant_id` (uuid) 工作空间(Tenant)ID
|
||||
- `app_id` (uuid) 应用 ID
|
||||
- `type` (string) 终端用户类型
|
||||
- `external_user_id` (string) 外部用户 ID
|
||||
- `name` (string) 名称
|
||||
- `is_anonymous` (boolean) 是否匿名
|
||||
- `session_id` (string) 会话 ID
|
||||
- `created_at` (string) ISO 8601 时间
|
||||
- `updated_at` (string) ISO 8601 时间
|
||||
|
||||
### Errors
|
||||
- 404,`end_user_not_found`,终端用户不存在
|
||||
- 500,内部服务器错误
|
||||
|
||||
</Col>
|
||||
<Col sticky>
|
||||
<CodeGroup
|
||||
title="Request"
|
||||
tag="GET"
|
||||
label="/end-users/:end_user_id"
|
||||
targetCode={`curl -X GET '${props.appDetail.api_base_url}/end-users/6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13' \\
|
||||
--header 'Authorization: Bearer {api_key}'`}
|
||||
/>
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Response' }}
|
||||
{
|
||||
"id": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
|
||||
"tenant_id": "8c0f3f3a-66b0-4b55-a0bf-8b8e0d6aee7d",
|
||||
"app_id": "6c8c3f41-2c6f-4e1b-8f4f-7f11c8f2ad2a",
|
||||
"type": "service_api",
|
||||
"external_user_id": "abc-123",
|
||||
"name": "Alice",
|
||||
"is_anonymous": false,
|
||||
"session_id": "abc-123",
|
||||
"created_at": "2024-01-01T00:00:00Z",
|
||||
"updated_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
---
|
||||
|
||||
<Heading
|
||||
url='/workflows/logs'
|
||||
method='GET'
|
||||
|
||||
Reference in New Issue
Block a user