Download OpenAPI specification:
NexusBook OpenAPI
🚀 NexusBook 是一个功能强大的开源文档管理和数据协作平台,为企业提供灵活的结构化数据管理、实时协作和供应链数据协同能力。
/api/v1/doc)/api/v1/organizations/{orgId})/api/v1/users, /api/v1/organizations, /api/v1/workspaces)/api/v1/webhooks):事件订阅和投递管理/api/v1/i18n):国际化翻译服务/api/v1/billing):订阅和计费管理/api/v1/audit):审计日志查询所有 API 请求需要在请求头中包含有效的 Bearer Token:
Authorization: Bearer <access_token>
获取 Token 的方式:
POST /auth/tokenGET /auth/authorize → POST /auth/token# 1. 获取聚合文档包(包含元数据、视图和数据)
curl -H 'Authorization: Bearer TOKEN' \
'https://open.nexusbook.app/api/v1/doc/product/doc-123?include=metadata,views,data'
# 2. 创建数据行
curl -X POST 'https://open.nexusbook.app/api/v1/doc/product/doc-123/data' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"id": "row-1",
"values": [
{"fieldId": "name", "value": {"text": "iPhone 15 Pro"}},
{"fieldId": "price", "value": {"number": 7999}},
{"fieldId": "stock", "value": {"number": 100}}
]
}'
# 3. 查询数据(高级查询)
curl -X POST 'https://open.nexusbook.app/api/v1/doc/product/doc-123/data/query' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"filter": {
"and": [
{"field": "price", "op": "gte", "value": 5000},
{"field": "stock", "op": "gt", "value": 0}
]
},
"sort": [{"field": "price", "order": "desc"}],
"page": 1,
"pageSize": 20
}'
# 1. 供应商创建 Catalog
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs' \
-H 'Authorization: Bearer TOKEN' \
-d '{
"name": "电子产品目录",
"catalogType": "product",
"fields": [
{"name": "品牌", "type": "text", "required": true},
{"name": "型号", "type": "text", "required": true},
{"name": "价格", "type": "currency", "required": true}
]
}'
# 2. 供应商创建 Connection 并分享
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/cat-456/connections' \
-H 'Authorization: Bearer TOKEN' \
-d '{
"name": "华东地区分销商",
"shareScope": {"type": "all"},
"accessControl": "public"
}'
# 3. 采购商接受连接并创建 OrderBook
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-789/orderbooks' \
-H 'Authorization: Bearer TOKEN' \
-d '{
"name": "供应商A订货本",
"sourceConnectionIds": ["conn-111"]
}'
# 4. 采购商配置 Binding(字段映射和过滤)
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-789/orderbooks/ob-222/bindings' \
-H 'Authorization: Bearer TOKEN' \
-d '{
"connectionId": "conn-111",
"fieldMapping": [
{"sourceFieldId": "price", "targetFieldId": "cost", "transformType": "unit_convert",
"unitConversion": {"fromUnit": "USD", "toUnit": "CNY", "rate": 7.2}}
],
"receiverFilter": {
"acceptMode": "selective",
"filterGroup": {
"operator": "AND",
"conditions": [{"field": "price", "op": "lte", "value": 10000}]
}
}
}'
NexusBook 的文档包含三个核心部分:
所有数据行更新操作使用版本号(version)进行乐观锁控制:
{
"id": "row-1",
"version": 3, // 必须提供当前版本号
"values": [...]
}
如果版本号不匹配,API 将返回 409 Conflict 错误。
所有错误响应遵循统一格式:
{
"success": false,
"code": "ERROR_CODE",
"message": {
"zh": "错误信息(中文)",
"en": "Error message (English)"
},
"details": { // 可选,提供额外的错误上下文
"field": "price",
"reason": "validation_failed"
}
}
常见错误码:
UNAUTHORIZED:未授权或 Token 无效FORBIDDEN:权限不足NOT_FOUND:资源不存在VALIDATION_ERROR:请求参数验证失败CONFLICT:并发冲突(版本号不匹配)RATE_LIMIT_EXCEEDED:请求频率超限GET /api/v1/doc/product/doc-123/data?page=1&pageSize=20
支持复杂过滤、排序、分组和聚合:
{
"filter": {
"and": [
{"field": "status", "op": "eq", "value": "active"},
{"or": [
{"field": "category", "op": "eq", "value": "electronics"},
{"field": "category", "op": "eq", "value": "computers"}
]}
]
},
"sort": [{"field": "createdAt", "order": "desc"}],
"page": 1,
"pageSize": 20
}
GET /api/v1/doc/product/doc-123/data?cursor=eyJ...&limit=100
获取当前用户信息 Get current user info
返回当前登录用户的完整信息,包括默认组织和工作区。 Returns complete info of the current logged-in user, including default organization and workspace.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/users/me' \
-H 'Authorization: Bearer TOKEN'
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}
}更新当前用户信息 Update current user info
更新当前用户的个人信息和偏好设置。 Update personal information and preferences of the current user.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/users/me' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "张三",
"locale": "zh-CN",
"timezone": "Asia/Shanghai"
}'
| displayName | string 显示名称 Display name |
| avatarUrl | string 头像URL Avatar URL |
| locale | string 语言偏好 Language preference |
| timezone | string 时区 Timezone |
| defaultOrganizationId | string 默认组织ID Default organization ID |
| defaultWorkspaceId | string 默认工作区ID Default workspace ID |
{- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}
}列出当前用户的 OAuth 连接 List current user's OAuth connections
获取当前用户已绑定的所有 OAuth 提供商列表。 Get the list of all OAuth providers bound to the current user.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/users/me/oauth' \
-H 'Authorization: Bearer TOKEN'
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "userId": "string",
- "provider": "google",
- "providerId": "string",
- "providerEmail": "string",
- "linkedAt": "string"
}
]
}绑定 OAuth 提供商 Bind OAuth provider
将第三方 OAuth 提供商与当前用户账号关联。 Associate a third-party OAuth provider with the current user account.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/users/me/oauth/github' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"authorizationCode": "AUTH_CODE_FROM_GITHUB"
}'
| provider required | string (Tenant.OAuthProvider) Enum: "google" "github" "wechat" "dingtalk" "feishu" OAuth 提供商名称 OAuth provider name |
绑定请求 Bind request
| authorizationCode required | string OAuth 授权码 OAuth authorization code |
| redirectUri | string 重定向 URI Redirect URI |
{- "authorizationCode": "string",
- "redirectUri": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "userId": "string",
- "provider": "google",
- "providerId": "string",
- "providerEmail": "string",
- "linkedAt": "string"
}
}解绑 OAuth 提供商 Unbind OAuth provider
移除当前用户与指定 OAuth 提供商的关联。 Remove the association between current user and specified OAuth provider.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/users/me/oauth/github' \
-H 'Authorization: Bearer TOKEN'
| provider required | string (Tenant.OAuthProvider) Enum: "google" "github" "wechat" "dingtalk" "feishu" OAuth 提供商名称 OAuth provider name |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}列出用户加入的组织 List user's organizations
返回用户作为成员的所有组织列表,包含角色信息。 Returns the list of all organizations where the user is a member, including role information.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/users/me/organizations?page=1&pageSize=20' \
-H 'Authorization: Bearer TOKEN'
| page | integer <int32> Default: 1 页码(从1开始) Page number (starts from 1) |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "organization": {
- "id": "string",
- "name": "string",
- "displayName": "string",
- "slug": "string",
- "description": "string",
- "logoUrl": "string",
- "type": "personal",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "status": "active",
- "settings": {
- "allowPublicJoin": true,
- "requireApproval": true,
- "inviteExpireDays": 0,
- "defaultRole": "owner",
- "allowedDomains": [
- "string"
]
}, - "memberCount": 0,
- "workspaceCount": 0,
- "createdAt": "string",
- "updatedAt": "string"
}, - "membership": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建组织 Create organization
创建一个新组织,创建者自动成为 owner,并自动创建一个默认工作区。 Create a new organization. The creator automatically becomes the owner, and a default workspace is created automatically.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "我的团队",
"slug": "my-team",
"type": "team",
"description": "团队描述"
}'
| name required | string 组织名称(必填) Organization name (required) |
| slug required | string URL标识(必填,全局唯一) URL slug (required, globally unique) |
| displayName | string 显示名称 Display name |
| description | string 组织描述 Organization description |
| type required | string Enum: "personal" "team" "enterprise" 组织类型 Organization type |
object 组织设置 Organization settings |
{- "name": "string",
- "slug": "string",
- "displayName": "string",
- "description": "string",
- "type": "personal",
- "settings": {
- "allowPublicJoin": true,
- "requireApproval": true,
- "inviteExpireDays": 0,
- "defaultRole": "owner",
- "allowedDomains": [
- "string"
]
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "displayName": "string",
- "slug": "string",
- "description": "string",
- "logoUrl": "string",
- "type": "personal",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "status": "active",
- "settings": {
- "allowPublicJoin": true,
- "requireApproval": true,
- "inviteExpireDays": 0,
- "defaultRole": "owner",
- "allowedDomains": [
- "string"
]
}, - "memberCount": 0,
- "workspaceCount": 0,
- "createdAt": "string",
- "updatedAt": "string"
}
}获取组织详情 Get organization detail
返回组织的详细信息,包括当前用户的角色和统计数据。 Returns detailed organization information including current user's role and statistics.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "currentUserRole": "owner",
- "owner": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "id": "string",
- "name": "string",
- "displayName": "string",
- "slug": "string",
- "description": "string",
- "logoUrl": "string",
- "type": "personal",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "status": "active",
- "settings": {
- "allowPublicJoin": true,
- "requireApproval": true,
- "inviteExpireDays": 0,
- "defaultRole": "owner",
- "allowedDomains": [
- "string"
]
}, - "memberCount": 0,
- "workspaceCount": 0,
- "createdAt": "string",
- "updatedAt": "string"
}
}更新组织信息 Update organization info
更新组织的基本信息和设置。需要 owner 或 admin 权限。 Update organization's basic information and settings. Requires owner or admin permission.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "新的显示名称",
"description": "更新后的描述"
}'
| organizationId required | string 组织ID Organization ID |
更新请求 Update request
| name | string 组织名称 Organization name |
| displayName | string 显示名称 Display name |
| description | string 组织描述 Organization description |
| logoUrl | string Logo URL Logo URL |
object 组织设置 Organization settings |
{- "name": "string",
- "displayName": "string",
- "description": "string",
- "logoUrl": "string",
- "settings": {
- "allowPublicJoin": true,
- "requireApproval": true,
- "inviteExpireDays": 0,
- "defaultRole": "owner",
- "allowedDomains": [
- "string"
]
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "displayName": "string",
- "slug": "string",
- "description": "string",
- "logoUrl": "string",
- "type": "personal",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "status": "active",
- "settings": {
- "allowPublicJoin": true,
- "requireApproval": true,
- "inviteExpireDays": 0,
- "defaultRole": "owner",
- "allowedDomains": [
- "string"
]
}, - "memberCount": 0,
- "workspaceCount": 0,
- "createdAt": "string",
- "updatedAt": "string"
}
}删除组织 Delete organization
软删除组织(标记为 archived)。仅 owner 可以执行此操作。 Soft delete organization (mark as archived). Only owner can perform this action.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}离开组织(用户主动) Leave organization (user initiated)
用户主动离开组织。owner 不能离开,需先转让所有权。 User leaves the organization voluntarily. Owner cannot leave without transferring ownership first.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/leave' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}列出组织成员 List organization members
获取组织的所有成员列表,支持按角色、状态过滤和搜索。 Get the list of all organization members, supporting filtering by role, status and search.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/members?page=1&pageSize=20&role=admin' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
| role | string (Tenant.OrganizationRole) Enum: "owner" "admin" "member" "guest" 按角色过滤 Filter by role |
| status | string (Tenant.MemberStatus) Enum: "active" "suspended" 按状态过滤 Filter by status |
| search | string 搜索成员(名称、邮箱) Search members (name, email) |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}添加组织成员(直接添加) Add organization member (direct add)
直接将用户添加为组织成员。需要 owner 或 admin 权限。 Directly add a user as an organization member. Requires owner or admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/members' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"userId": "user-456",
"role": "member"
}'
| organizationId required | string 组织ID Organization ID |
添加成员请求 Add member request
| userId required | string 用户ID(必填) User ID (required) |
| role | string Default: "member" Enum: "owner" "admin" "member" "guest" 角色(默认 member) Role (default: member) |
{- "userId": "string",
- "role": "member"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}获取组织成员详情 Get organization member detail
获取指定成员的详细信息。 Get detailed information of a specified member.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/members/member-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| memberId required | string 成员ID Member ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}更新成员角色 Update member role
更新组织成员的角色或状态。需要 owner 或 admin 权限。 Update organization member's role or status. Requires owner or admin permission.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/members/member-789' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"role": "admin"
}'
| organizationId required | string 组织ID Organization ID |
| memberId required | string 成员ID Member ID |
更新请求 Update request
| role | string Enum: "owner" "admin" "member" "guest" 新角色 New role |
| status | string Enum: "active" "suspended" 状态 Status |
{- "role": "owner",
- "status": "active"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}移除组织成员 Remove organization member
从组织中移除成员。需要 owner 或 admin 权限,不能移除 owner。 Remove a member from the organization. Requires owner or admin permission. Cannot remove owner.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/members/member-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| memberId required | string 成员ID Member ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}创建工作区 Create workspace
在组织下创建新工作区。需要 organization.owner 或 organization.admin 权限。 Create a new workspace under the organization. Requires organization.owner or organization.admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "产品团队",
"slug": "product-team",
"description": "产品开发工作区",
"visibility": "private"
}'
| organizationId required | string 组织ID Organization ID |
创建请求 Create request
| name required | string 工作区名称(必填) Workspace name (required) |
| slug required | string URL标识(组织内唯一,必填) URL slug (unique within organization, required) |
| description | string 工作区描述 Workspace description |
| icon | string 工作区图标 Workspace icon |
| color | string 主题颜色 Theme color |
| visibility | string Default: "private" Enum: "public" "private" 可见性(默认 private) Visibility (default: private) |
Array of objects (Tenant.DataSourceReference) 数据源引用配置 Data source reference configuration 允许工作区引用其他工作区的特定 document type 数据。 Allows workspace to reference specific document types from other workspaces. |
{- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "visibility": "private",
- "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "isDefault": true,
- "visibility": "public",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
], - "settings": { },
- "memberCount": 0,
- "documentCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "archivedAt": "string"
}
}列出组织的工作区 List organization's workspaces
获取组织下所有工作区列表,仅返回用户有权限访问的工作区。 Get the list of all workspaces under the organization. Only returns workspaces the user has permission to access.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces?page=1&pageSize=20' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
| visibility | string (Tenant.WorkspaceVisibility) Enum: "public" "private" 过滤可见性 Filter by visibility |
| includeArchived | boolean Default: false 是否包含归档的工作区 Whether to include archived workspaces |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "organizationId": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "isDefault": true,
- "visibility": "public",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
], - "settings": { },
- "memberCount": 0,
- "documentCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "archivedAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取工作区详情 Get workspace detail
返回工作区的详细信息。需要是工作区成员。 Returns detailed workspace information. Requires workspace membership.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "currentUserRole": "owner",
- "owner": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "id": "string",
- "organizationId": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "isDefault": true,
- "visibility": "public",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
], - "settings": { },
- "memberCount": 0,
- "documentCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "archivedAt": "string"
}
}更新工作区信息 Update workspace info
更新工作区的基本信息。需要 workspace.owner 权限。 Update workspace's basic information. Requires workspace.owner permission.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "新的工作区名称",
"description": "更新后的描述"
}'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
更新请求 Update request
| name | string 工作区名称 Workspace name |
| description | string 工作区描述 Workspace description |
| icon | string 工作区图标 Workspace icon |
| color | string 主题颜色 Theme color |
| visibility | string Enum: "public" "private" 可见性 Visibility |
Array of objects (Tenant.DataSourceReference) 数据源引用配置 Data source reference configuration 允许工作区引用其他工作区的特定 document type 数据。 Allows workspace to reference specific document types from other workspaces. |
{- "name": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "visibility": "public",
- "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "isDefault": true,
- "visibility": "public",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
], - "settings": { },
- "memberCount": 0,
- "documentCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "archivedAt": "string"
}
}删除工作区 Delete workspace
软删除工作区。需要 workspace.owner 或 organization.owner 权限。 Soft delete workspace. Requires workspace.owner or organization.owner permission.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}归档工作区 Archive workspace
归档工作区。需要 workspace.owner 或 organization.owner/admin 权限。 Archive workspace. Requires workspace.owner or organization.owner/admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/archive' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "isDefault": true,
- "visibility": "public",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
], - "settings": { },
- "memberCount": 0,
- "documentCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "archivedAt": "string"
}
}列出工作区成员 List workspace members
获取工作区的所有成员列表。需要是工作区成员。 Get the list of all workspace members. Requires workspace membership.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/members' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
| role | string (Tenant.WorkspaceRole) Enum: "owner" "editor" "viewer" 按角色过滤 Filter by role |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "workspaceId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "addedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}添加工作区成员 Add workspace member
将用户添加为工作区成员。需要 workspace.owner 权限。用户必须是组织成员。 Add a user as workspace member. Requires workspace.owner permission. User must be organization member.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/members' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"userId": "user-789",
"role": "editor"
}'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
添加成员请求 Add member request
| userId required | string 用户ID(必填,必须是组织成员) User ID (required, must be organization member) |
| role | string Default: "editor" Enum: "owner" "editor" "viewer" 角色(默认 editor) Role (default: editor) |
{- "userId": "string",
- "role": "editor"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "workspaceId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "addedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}获取工作区成员详情 Get workspace member detail
获取指定成员的详细信息。 Get detailed information of a specified member.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/members/member-999' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
| memberId required | string 成员ID Member ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "workspaceId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "addedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}更新工作区成员角色 Update workspace member role
更新工作区成员的角色或状态。需要 workspace.owner 权限。 Update workspace member's role or status. Requires workspace.owner permission.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/members/member-999' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"role": "viewer"
}'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
| memberId required | string 成员ID Member ID |
更新请求 Update request
| role | string Enum: "owner" "editor" "viewer" 新角色 New role |
| status | string Enum: "active" "suspended" 状态 Status |
{- "role": "owner",
- "status": "active"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "workspaceId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "addedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}移除工作区成员 Remove workspace member
从工作区移除成员。需要 workspace.owner 权限。 Remove a member from the workspace. Requires workspace.owner permission.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/members/member-999' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
| memberId required | string 成员ID Member ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}恢复归档的工作区 Restore archived workspace
恢复已归档的工作区。需要 workspace.owner 或 organization.owner/admin 权限。 Restore an archived workspace. Requires workspace.owner or organization.owner/admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/restore' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "name": "string",
- "slug": "string",
- "description": "string",
- "icon": "string",
- "color": "string",
- "isDefault": true,
- "visibility": "public",
- "ownerId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "dataSourceReferences": [
- {
- "sourceWorkspaceId": "string",
- "documentType": "string",
- "mode": "readonly",
- "priority": 0
}
], - "settings": { },
- "memberCount": 0,
- "documentCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "archivedAt": "string"
}
}通过令牌获取邀请信息 Get invitation by token
使用邀请令牌获取邀请详情(用于邀请接受页面展示)。 Get invitation details using invitation token (for invitation acceptance page display).
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/invitations/TOKEN_STRING' \
-H 'Authorization: Bearer TOKEN'
| token required | string 邀请令牌 Invitation token |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "email": "string",
- "inviterUserId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "inviter": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "token": "string",
- "message": "string",
- "status": "pending",
- "expiresAt": "string",
- "acceptedAt": "string",
- "acceptedByUserId": "string",
- "createdAt": "string"
}
}接受邀请 Accept invitation
通过邀请令牌接受邀请加入组织。验证邮箱匹配后创建成员记录。 Accept an invitation to join the organization using invitation token. Creates member record after email verification.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/invitations/TOKEN_STRING/accept' \
-H 'Authorization: Bearer TOKEN'
| token required | string 邀请令牌 Invitation token |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}拒绝邀请 Decline invitation
拒绝邀请加入组织。 Decline an invitation to join the organization.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/invitations/TOKEN_STRING/decline' \
-H 'Authorization: Bearer TOKEN'
| token required | string 邀请令牌 Invitation token |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}创建邀请 Create invitation
邀请用户加入组织。需要 owner 或 admin 权限。 Invite a user to join the organization. Requires owner or admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/invitations' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"role": "member",
"message": "欢迎加入我们的团队!",
"expiresInDays": 7
}'
| organizationId required | string 组织ID Organization ID |
创建邀请请求 Create invitation request
| email required | string 被邀请人邮箱(必填) Invitee email (required) |
| role | string Default: "member" Enum: "owner" "admin" "member" "guest" 邀请角色(默认 member) Invited role (default: member) |
| message | string 邀请留言 Invitation message |
| expiresInDays | integer <int32> Default: 7 有效期(天数,默认7天) Expiration days (default: 7) |
{- "email": "string",
- "role": "member",
- "message": "string",
- "expiresInDays": 7
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "email": "string",
- "inviterUserId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "inviter": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "token": "string",
- "message": "string",
- "status": "pending",
- "expiresAt": "string",
- "acceptedAt": "string",
- "acceptedByUserId": "string",
- "createdAt": "string"
}
}列出组织邀请 List organization invitations
获取组织的所有邀请列表。需要 owner 或 admin 权限。 Get the list of all invitations of the organization. Requires owner or admin permission.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/invitations?status=pending' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
| status | string (Tenant.InvitationStatus) Enum: "pending" "accepted" "expired" "revoked" 按状态过滤 Filter by status |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "organizationId": "string",
- "email": "string",
- "inviterUserId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "inviter": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "token": "string",
- "message": "string",
- "status": "pending",
- "expiresAt": "string",
- "acceptedAt": "string",
- "acceptedByUserId": "string",
- "createdAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取邀请详情 Get invitation detail
获取指定邀请的详细信息。 Get detailed information of a specified invitation.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/invitations/inv-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| invitationId required | string 邀请ID Invitation ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "email": "string",
- "inviterUserId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "inviter": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "token": "string",
- "message": "string",
- "status": "pending",
- "expiresAt": "string",
- "acceptedAt": "string",
- "acceptedByUserId": "string",
- "createdAt": "string"
}
}撤销邀请 Revoke invitation
撤销未接受的邀请。需要 owner 或 admin 权限,或是邀请创建者。 Revoke an unaccepted invitation. Requires owner or admin permission, or being the inviter.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/invitations/inv-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| invitationId required | string 邀请ID Invitation ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}申请加入组织 Apply to join organization
提交加入组织的申请。前置条件:用户未加入该组织,组织允许申请加入。 Submit an application to join the organization. Prerequisites: user is not a member, organization allows join requests.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/join-requests' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"message": "我希望加入贵团队,我有5年相关经验..."
}'
| organizationId required | string 组织ID Organization ID |
创建申请请求 Create request
| message | string 申请说明 Application message |
{- "message": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "message": "string",
- "status": "pending",
- "reviewedBy": "string",
- "reviewer": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "reviewNote": "string",
- "createdAt": "string",
- "reviewedAt": "string"
}
}列出加入申请 List join requests
获取组织的所有加入申请列表。需要 owner 或 admin 权限。 Get the list of all join requests of the organization. Requires owner or admin permission.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/join-requests?status=pending' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
| status | string (Tenant.JoinRequestStatus) Enum: "pending" "approved" "rejected" "cancelled" 按状态过滤 Filter by status |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "message": "string",
- "status": "pending",
- "reviewedBy": "string",
- "reviewer": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "reviewNote": "string",
- "createdAt": "string",
- "reviewedAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取加入申请详情 Get join request detail
获取指定加入申请的详细信息。 Get detailed information of a specified join request.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/join-requests/req-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| requestId required | string 申请ID Request ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "message": "string",
- "status": "pending",
- "reviewedBy": "string",
- "reviewer": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "reviewNote": "string",
- "createdAt": "string",
- "reviewedAt": "string"
}
}取消加入申请(用户主动) Cancel join request (user initiated)
用户取消自己的加入申请。仅申请创建者本人可操作。 User cancels their own join request. Only the applicant can perform this action.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/join-requests/req-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| requestId required | string 申请ID Request ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}批准加入申请 Approve join request
批准用户的加入申请,创建组织成员记录并发送通知。需要 owner 或 admin 权限。 Approve user's join request, create member record and send notification. Requires owner or admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/join-requests/req-789/approve' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"role": "member",
"reviewNote": "欢迎加入!"
}'
| organizationId required | string 组织ID Organization ID |
| requestId required | string 申请ID Request ID |
批准请求 Approve request
| role | string Enum: "owner" "admin" "member" "guest" 授予的角色(默认使用组织默认角色) Granted role (default: use organization default role) |
| reviewNote | string 审核备注 Review note |
{- "role": "owner",
- "reviewNote": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "role": "owner",
- "status": "active",
- "joinedAt": "string",
- "invitedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}拒绝加入申请 Reject join request
拒绝用户的加入申请并发送通知。需要 owner 或 admin 权限。 Reject user's join request and send notification. Requires owner or admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/join-requests/req-789/reject' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"reviewNote": "很抱歉,暂时不符合我们的要求"
}'
| organizationId required | string 组织ID Organization ID |
| requestId required | string 申请ID Request ID |
拒绝请求 Reject request
| reviewNote required | string 拒绝原因 Rejection reason |
{- "reviewNote": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "userId": "string",
- "user": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "message": "string",
- "status": "pending",
- "reviewedBy": "string",
- "reviewer": {
- "id": "string",
- "username": "string",
- "email": "string",
- "emailVerified": true,
- "displayName": "string",
- "avatarUrl": "string",
- "locale": "string",
- "timezone": "string",
- "status": "active",
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "lastLoginAt": "string"
}, - "reviewNote": "string",
- "createdAt": "string",
- "reviewedAt": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}更新文档类型公共设置。
Update type-level settings.
| docType required | string |
| defaultViewId | string 默认视图ID Default view id |
object 分享配置 | |
| permissions | any 权限策略 Permissions policy |
object 保留策略 |
{- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}获取聚合文档包(支持 include 选择与分页)
Fetch aggregated doc bundle (supports include selection and pagination)
一次性获取文档的所需数据:通过 include 指定返回部分(如 metadata,views,data,comments,revisions,settings),
支持视图分页(page/pageSize)与限制数量(commentsLimit/revisionsLimit)。
Fetch aggregated doc bundle with selective sections via include (e.g. metadata,views,data,comments,revisions,settings),
supports view paging (page/pageSize) and limits (commentsLimit/revisionsLimit).
示例(cURL):
curl -H 'Authorization: Bearer TOKEN' \
'https://open.nexusbook.app/api/v1/doc/product/123?include=metadata,views,data&page=1&pageSize=20'
| docType required | string |
| docId required | string |
| include | string |
| viewId | string |
| page | integer <int32> |
| pageSize | integer <int32> |
| commentsLimit | integer <int32> |
| revisionsLimit | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "properties": {
- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}, - "metadata": {
- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
], - "properties": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
]
}, - "views": [
- {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
], - "data": {
- "items": [
- {
- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}, - "comments": [
- {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
], - "revisions": [
- {
- "id": "string",
- "version": 0,
- "requestId": "string",
- "title": "string",
- "description": "string",
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "rowsCreated": 0,
- "rowsUpdated": 0,
- "rowsDeleted": 0,
- "fieldsCreated": 0,
- "fieldsUpdated": 0,
- "fieldsDeleted": 0,
- "metadataChanges": 0,
- "settingsChanges": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "previousRevisionId": "string"
}
], - "settings": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}
}返回字段定义与显示配置,供渲染与校验使用。
Returns field definitions and display settings for rendering and validation.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
], - "properties": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
]
}
}更新字段与显示配置,需具备管理权限。
Update fields and display settings, requires manage permission.
| docType required | string |
| docId required | string |
required | Array of objects (Document.Field) 数据行字段定义 Data row field definitions 定义数据行(表格行)的字段结构。 Defines the field structure for data rows (table rows). |
Array of objects (Document.Field) 文档属性字段定义 Document property field definitions 定义文档级别属性的字段结构(如订单时间、总金额等)。 Defines the field structure for document-level properties (e.g., order time, total amount). 这些字段定义用于 |
{- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
], - "properties": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
], - "properties": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
]
}
}获取文档级设置。
Get doc-level settings.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}更新文档级设置。
Update doc-level settings.
| docType required | string |
| docId required | string |
| defaultViewId | string 默认视图ID Default view id |
object 分享配置 | |
| permissions | any 权限策略 Permissions policy |
object 保留策略 |
{- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}以分页返回数据行,支持简单 DSL 查询参数(page/pageSize/sort/filter/group/cursor)。
List rows with pagination, supports simple DSL query parameters
(page/pageSize/sort/filter/group/cursor).
如果提供 requestId 参数,返回的数据将是:
生产数据 + Request 变更的叠加视图。
If requestId is provided, the returned data will be:
Production data + Request changes merged view.
示例:
# 查看生产数据
GET /api/v1/doc/product/123/data
# 预览变更效果(叠加 Request 变更)
GET /api/v1/doc/product/123/data?requestId=req-abc
# 查看变更详情(包含变更标记)
GET /api/v1/doc/product/123/data?requestId=req-abc&includeChanges=true
| docType required | string |
| docId required | string |
| page | integer <int32> |
| pageSize | integer <int32> |
| sort | string |
| filter | string |
| group | string |
| cursor | string |
| requestId | string |
| includeChanges | boolean |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建数据行(进入变更请求)
Create data row (goes into change request)
创建的数据行会添加到指定的变更请求中,不会立即生效。 Created row will be added to the specified change request, not applied immediately.
requestId,追加到该请求Request workflow:
requestId specified, append to that request示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/doc/product/123/data?requestId=req-1' \\
-H 'Authorization: Bearer TOKEN' \\
-H 'Content-Type: application/json' \\
-d '{"id":"row-1","values":[{"fieldId":"name","value":{"text":"新产品"}}]}'
| docType required | string |
| docId required | string |
| requestId | string |
| id required | string 行ID Row id 数据行唯一标识。 Unique identifier of the row. |
required | Array of objects (Common.ValueEntry) 字段值集合 Field values 字段ID与值的集合。 Collection of field ids and values. |
| createdAt | string 创建时间 Created at 创建时间戳。 Created timestamp. |
object 创建人 Created by 创建者。 Author. | |
| updatedAt | string 更新时间 Updated at 更新时间戳。 Updated timestamp. |
object 更新人 Updated by 更新者。 Updater. | |
| version | integer <int64> 版本(并发控制) Version 版本号用于并发控制。 Version number for concurrency control. |
{- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}批量更新数据和属性(进入变更请求)
Bulk update data and properties (goes into change request)
灵活的批量更新接口,支持:
Flexible bulk update interface supporting:
示例(cURL):
# 1. 修改单个字段
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{"target": {"row": "row-1", "field": "price"}, "value": 99.99}
]'
# 2. 修改整行
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{
"target": {"row": "row-1"},
"value": {"price": 99.99, "name": "iPhone 15", "stock": 50}
}
]'
# 3. 修改多行的同一字段
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{
"target": {"rows": ["row-1", "row-2", "row-3"], "field": "status"},
"value": "active"
}
]'
# 4. 修改多行的同一字段(不同值)
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{
"target": {"rows": ["row-1", "row-2", "row-3"], "field": "price"},
"value": [99.99, 88.88, 77.77]
}
]'
# 5. 修改单个属性
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{"target": {"property": "amount"}, "value": 5000.00}
]'
# 6. 修改多个属性
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{
"target": {"properties": true},
"value": {"amount": 5000.00, "quantity": 100, "date": "2024-12-05"}
}
]'
# 7. 混合更新(数据 + 属性)
curl -X POST '.../data/bulk?requestId=req-1' -d '[
{"target": {"row": "row-1", "field": "price"}, "value": 99.99},
{"target": {"property": "amount"}, "value": 5000.00}
]'
服务端处理逻辑:
Server processing:
| docType required | string |
| docId required | string |
| requestId | string |
| target required | object 目标(灵活结构) Target (flexible structure) 支持多种目标指定方式:
Supports multiple target specification methods:
|
| value | any 值(原始格式,可以是单值、对象或数组) Value (raw format, can be single value, object or array) 根据 target 的不同,value 可以是:
Depending on target, value can be:
服务端根据 metadata 自动解析值的类型。 Server auto-parses value type based on metadata. 注意:删除操作(delete: true)不需要提供 value。 Note: Delete operations (delete: true) do not require value. |
[- {
- "target": { },
- "value": null
}
]{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}以结构化体进行复杂查询(嵌套过滤、排序、分页)。
Perform complex query with structured body (nested filters, sorts, pagination).
注意:如果需要分组查询,请使用 /query/group 接口。
Note: For group queries, use /query/group endpoint.
支持通过 requestId 查询参数获取叠加后的数据视图。
Supports requestId query parameter for merged data view.
| docType required | string |
| docId required | string |
| requestId | string |
| includeChanges | boolean |
object 过滤 Filters 嵌套过滤组合。 Nested filter groups. | |
Array of objects (Common.Sort) 排序 Sorts 排序条件集合。 Sort conditions. | |
object 分组与聚合 Group and aggregations 分组字段与聚合函数。 Group fields and aggregation functions. | |
| page | integer <int32> 页码 Page number 页码(默认1)。 Page number (default 1). |
| pageSize | integer <int32> 每页数量 Page size 每页数量(默认20,最大200)。 Page size (default 20, max 200). |
| cursor | string 游标 Cursor 游标用于深分页。 Cursor for deep pagination. |
{- "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "page": 0,
- "pageSize": 0,
- "cursor": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}分组查询接口(支持多级分组与聚合)
Group query endpoint (supports multi-level grouping and aggregations)
该接口专门用于分组查询,返回树状结构的分组结果。 This endpoint is specifically for grouped queries, returning tree-structured group results.
{
"filters": {...},
"group": {
"fields": ["category"],
"aggregations": [
{"kind": "count", "field": "*"},
{"kind": "sum", "field": "amount"}
]
}
}
{
"group": {
"fields": ["region", "category"],
"aggregations": [
{"kind": "count", "field": "*"},
{"kind": "sum", "field": "revenue"}
]
}
}
{
"group": {
"fields": ["region", "category", "status"],
"aggregations": [{"kind": "count", "field": "*"}]
}
}
{
"groups": [
{
"key": "North",
"field": "region",
"count": 100,
"aggregations": {"count_*": 100, "sum_revenue": 50000},
"children": [
{
"key": "Electronics",
"field": "category",
"count": 60,
"aggregations": {"count_*": 60, "sum_revenue": 30000}
},
{
"key": "Clothing",
"field": "category",
"count": 40,
"aggregations": {"count_*": 40, "sum_revenue": 20000}
}
]
}
],
"total": 100,
"groupBy": {...}
}
支持通过 requestId 查询参数获取叠加后的数据视图。
Supports requestId query parameter for merged data view.
| docType required | string |
| docId required | string |
| requestId | string |
| includeChanges | boolean |
| includeRows | boolean |
object 过滤 Filters 嵌套过滤组合。 Nested filter groups. | |
Array of objects (Common.Sort) 排序 Sorts 排序条件集合。 Sort conditions. | |
object 分组与聚合 Group and aggregations 分组字段与聚合函数。 Group fields and aggregation functions. | |
| page | integer <int32> 页码 Page number 页码(默认1)。 Page number (default 1). |
| pageSize | integer <int32> 每页数量 Page size 每页数量(默认20,最大200)。 Page size (default 20, max 200). |
| cursor | string 游标 Cursor 游标用于深分页。 Cursor for deep pagination. |
{- "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "page": 0,
- "pageSize": 0,
- "cursor": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "groups": [
- {
- "key": null,
- "field": "string",
- "count": 0,
- "aggregations": {
- "property1": null,
- "property2": null
}, - "children": [
- { }
], - "rows": [
- {
- "property1": null,
- "property2": null
}
]
}
], - "total": 0,
- "groupBy": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}
}
}返回单条数据行详情。
Return single row detail.
支持通过 requestId 查询参数获取叠加后的数据视图。
Supports requestId query parameter for merged data view.
| docType required | string |
| docId required | string |
| rowId required | string |
| requestId | string |
| includeChanges | boolean |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}
}更新数据行(进入变更请求)
Update data row (goes into change request)
更新的数据行会添加到指定的变更请求中,不会立即生效。 Updated row will be added to the specified change request, not applied immediately.
| docType required | string |
| docId required | string |
| rowId required | string |
| requestId | string |
| id required | string 行ID Row id 数据行唯一标识。 Unique identifier of the row. |
required | Array of objects (Common.ValueEntry) 字段值集合 Field values 字段ID与值的集合。 Collection of field ids and values. |
| createdAt | string 创建时间 Created at 创建时间戳。 Created timestamp. |
object 创建人 Created by 创建者。 Author. | |
| updatedAt | string 更新时间 Updated at 更新时间戳。 Updated timestamp. |
object 更新人 Updated by 更新者。 Updater. | |
| version | integer <int64> 版本(并发控制) Version 版本号用于并发控制。 Version number for concurrency control. |
{- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}删除数据行(进入变更请求)
Delete data row (goes into change request)
删除操作会添加到指定的变更请求中,不会立即生效。 Delete operation will be added to the specified change request, not applied immediately.
| docType required | string |
| docId required | string |
| rowId required | string |
| requestId | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}返回指定文档的视图列表。
List all views of the document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
]
}创建新的视图定义。
Create a new view.
| docType required | string |
| docId required | string |
| id required | string 视图唱一标识 Unique identifier of the view |
| name required | string 视图显示名称 Display name of the view |
| type | string Enum: "table" "gallery" "kanban" "calendar" "chart" "form" "map" "timeline" 视图类型(表格/相册/看板/文档) View type (grid/gallery/kanban/document) |
| displayFields | Array of strings 用于渲染的字段列表 Field list used for rendering |
object 过滤条件组合 Filter conditions group | |
Array of objects (Common.Sort) 排序条件 Sort conditions | |
object 分组与聚合 Grouping and aggregations | |
object 列展示配置(宽度/顺序/固定/隐藏) Column display configuration (width/order/pinned/hidden) |
{- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
}获取视图配置与定义。
Get view definition and configuration.
| docType required | string |
| docId required | string |
| viewId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
}更新视图定义与配置。
Update view definition and configuration.
| docType required | string |
| docId required | string |
| viewId required | string |
| id required | string 视图唱一标识 Unique identifier of the view |
| name required | string 视图显示名称 Display name of the view |
| type | string Enum: "table" "gallery" "kanban" "calendar" "chart" "form" "map" "timeline" 视图类型(表格/相册/看板/文档) View type (grid/gallery/kanban/document) |
| displayFields | Array of strings 用于渲染的字段列表 Field list used for rendering |
object 过滤条件组合 Filter conditions group | |
Array of objects (Common.Sort) 排序条件 Sort conditions | |
object 分组与聚合 Grouping and aggregations | |
object 列展示配置(宽度/顺序/固定/隐藏) Column display configuration (width/order/pinned/hidden) |
{- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
}将指定视图设为默认视图。
Set specified view as default.
| docType required | string |
| docId required | string |
| viewId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取文档属性
Get document properties
获取文档级别的所有元信息(订单时间、门店、金额等)。 Get all document-level metadata (order time, store, amount, etc).
支持通过 requestId 查询参数获取叠加后的属性视图。
Supports requestId query parameter for merged properties view.
| docType required | string |
| docId required | string |
| requestId | string |
| includeChanges | boolean |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}创建或初始化文档属性
Create or initialize document properties
为新文档初始化属性。通常在文档创建时调用。 Initialize properties for new document. Typically called when document is created.
| docType required | string |
| docId required | string |
| id required | string 属性ID Property id 唯一标识。 Unique identifier. |
| docId required | string 文档ID Document id 关联的文档ID。 Associated document id. |
| docType required | string 文档类型 Document type 文档类型(如 purchaseOrder、invoice、product)。 Document type (e.g. purchaseOrder, invoice, product). |
| organizationId | string 所属组织ID Organization ID 文档所属的组织(可选,用于多租户隔离)。 Organization that owns this document (optional, for multi-tenancy isolation). |
| workspaceId | string 所属工作区ID Workspace ID 文档所属的工作区(可选,为空表示组织级文档)。 Workspace that owns this document (optional, empty means organization-level document). |
Array of objects (Common.ValueEntry) 属性值集合 Property values 使用类型化的值结构,与数据行的 cell 值设计一致。 Uses typed value structure, consistent with data row cell values. 每个属性都有字段ID和对应的类型化值。 Each property has a field ID and corresponding typed value. 示例:
| |
| version | integer <int64> 版本号 Version 用于并发控制。 For concurrency control. |
| createdAt | string 创建时间 Created at 创建时间戳。 Created timestamp. |
| updatedAt | string 更新时间 Updated at 更新时间戳。 Updated timestamp. |
object 更新人 Updated by 最后更新的用户。 User who last updated. |
{- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}完全替换文档属性(进入变更请求)
Replace document properties completely (goes into change request)
用新的属性集合完全替换现有属性。变更会添加到指定的变更请求中。 Replace existing properties with a new set. Changes will be added to the specified change request.
requestId,追加到该请求示例(cURL):
curl -X PUT 'https://open.nexusbook.app/api/v1/doc/purchaseOrder/order-123/properties?requestId=req-1' \\
-H 'Authorization: Bearer TOKEN' \\
-H 'Content-Type: application/json' \\
-d '{
"id": "prop-123",
"docId": "order-123",
"docType": "purchaseOrder",
"version": 1,
"properties": [
{"fieldId": "orderTime", "value": {"datetime": "2024-12-01T10:00:00Z"}},
{"fieldId": "store", "value": {"text": "Beijing Branch"}},
{"fieldId": "amount", "value": {"currency": 5000.00}},
{"fieldId": "quantity", "value": {"number": 50}}
]
}'
| docType required | string |
| docId required | string |
| requestId | string |
| id required | string 属性ID Property id 唯一标识。 Unique identifier. |
| docId required | string 文档ID Document id 关联的文档ID。 Associated document id. |
| docType required | string 文档类型 Document type 文档类型(如 purchaseOrder、invoice、product)。 Document type (e.g. purchaseOrder, invoice, product). |
| organizationId | string 所属组织ID Organization ID 文档所属的组织(可选,用于多租户隔离)。 Organization that owns this document (optional, for multi-tenancy isolation). |
| workspaceId | string 所属工作区ID Workspace ID 文档所属的工作区(可选,为空表示组织级文档)。 Workspace that owns this document (optional, empty means organization-level document). |
Array of objects (Common.ValueEntry) 属性值集合 Property values 使用类型化的值结构,与数据行的 cell 值设计一致。 Uses typed value structure, consistent with data row cell values. 每个属性都有字段ID和对应的类型化值。 Each property has a field ID and corresponding typed value. 示例:
| |
| version | integer <int64> 版本号 Version 用于并发控制。 For concurrency control. |
| createdAt | string 创建时间 Created at 创建时间戳。 Created timestamp. |
| updatedAt | string 更新时间 Updated at 更新时间戳。 Updated timestamp. |
object 更新人 Updated by 最后更新的用户。 User who last updated. |
{- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}部分更新文档属性(进入变更请求)
Partially update document properties (goes into change request)
仅更新指定的属性字段,保留其他字段。变更会添加到指定的变更请求中。 Update only specified property fields, preserve others. Changes will be added to the specified change request.
简化提交方式:
Simplified submission:
查询参数:
requestId - 指定要追加到的请求ID(可选)merge=true - 合并模式(默认):新值与现有值合并merge=false - 覆盖模式:新值覆盖现有值version - 当前版本号(用于并发检查)Query parameters:
requestId - Specify which request to append to (optional)merge=true - Merge mode (default): merge new values with existingmerge=false - Overwrite mode: new values override existingversion - Current version number (for concurrency check)示例(cURL)- 仅更新订单金额和数量:
curl -X PATCH 'https://open.nexusbook.app/api/v1/doc/purchaseOrder/order-123/properties?requestId=req-1&merge=true&version=1' \\
-H 'Authorization: Bearer TOKEN' \\
-H 'Content-Type: application/json' \\
-d '{
"updates": [
{"fieldId": "amount", "value": 6000.00},
{"fieldId": "quantity", "value": 60}
]
}'
服务端处理逻辑:
Server processing:
| docType required | string |
| docId required | string |
| requestId | string |
| merge | boolean |
| version | integer <int64> |
Array of objects 要更新的属性值数组(简化格式) Property values to update (simplified format) 直接提供 fieldId 和原始值,服务端根据 metadata 自动解析类型。 Provide fieldId and raw value directly, server auto-parses type based on metadata. | |
| note | string 更新说明 Update note |
{- "updates": [
- {
- "fieldId": "string",
- "value": null
}
], - "note": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}删除文档属性
Delete document properties
删除文档的所有属性数据。此操作无法撤销,请谨慎。 Delete all property data of the document. This action cannot be undone, use with caution.
| docType required | string |
| docId required | string |
| version | integer <int64> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取属性的修订历史
Get properties revision history
查看属性的所有历史变更记录。 View all historical changes of properties.
| docType required | string |
| docId required | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "version": 0,
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "note": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}列出所有关联关系
List all relations
查询文档的所有关联关系,支持过滤。 Query all relations of the document, supports filtering.
| docType required | string |
| docId required | string |
| fieldId | string |
| targetDocType | string |
| targetDocId | string |
| includeDetails | boolean |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "relation": {
- "id": "string",
- "sourceDocType": "string",
- "sourceDocId": "string",
- "sourceRowId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}, - "targetRow": null,
- "targetMetadata": null
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建关联关系
Create relation
在两个文档行之间创建关联。如果配置为双向关联,会自动在目标端创建反向关联。 Create relation between two document rows. If bidirectional, automatically creates reverse relation.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/doc/order/123/relations' \
-H 'Authorization: Bearer TOKEN' \
-d '{
"sourceRowId": "row-1",
"fieldId": "products",
"targetDocType": "product",
"targetDocId": "456",
"targetRowId": "row-2",
"metadata": {"quantity": 10}
}'
| docType required | string |
| docId required | string |
| sourceRowId required | string 源行ID Source row id |
| fieldId required | string 源字段ID Source field id |
| targetDocType required | string 目标文档类型 Target document type |
| targetDocId required | string 目标文档ID Target document id |
| targetRowId required | string 目标行ID Target row id |
| metadata | any 关联元数据 Relation metadata |
{- "sourceRowId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "metadata": null
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "sourceDocType": "string",
- "sourceDocId": "string",
- "sourceRowId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}批量创建关联
Batch create relations
一次性创建多个关联关系。 Create multiple relations at once.
| docType required | string |
| docId required | string |
| sourceRowId required | string |
| fieldId required | string |
| targetDocType required | string |
| targetDocId required | string |
| targetRowId required | string |
| metadata | any |
[- {
- "sourceRowId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "metadata": null
}
]{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "created": 0,
- "relations": [
- {
- "id": "string",
- "sourceDocType": "string",
- "sourceDocId": "string",
- "sourceRowId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "failures": [
- {
- "index": 0,
- "reason": "string"
}
]
}
}批量删除关联
Batch delete relations
根据条件批量删除关联关系。 Delete relations in batch by conditions.
| docType required | string |
| docId required | string |
| sourceRowId | string |
| fieldId | string |
| targetDocType | string |
| targetRowId | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "deleted": 0
}
}检查循环引用
Check circular reference
检查创建关联是否会导致循环引用。 Check if creating relation would cause circular reference.
| docType required | string |
| docId required | string |
| sourceRowId required | string |
| fieldId required | string |
| targetDocType required | string |
| targetDocId required | string |
| targetRowId required | string |
{- "sourceRowId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "targetRowId": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "hasCircular": true,
- "circularPath": [
- "string"
]
}
}获取文档的关联配置
Get document relation configurations
返回该文档所有字段的关联配置。 Return all field relation configurations of the document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "sourceDocType": "string",
- "sourceDocId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "bidirectional": true,
- "reverseFieldId": "string",
- "cascadeDelete": "none",
- "validation": {
- "allowDuplicates": true,
- "maxLinks": 0,
- "minLinks": 0,
- "preventCircular": true
}, - "createdAt": "string",
- "updatedAt": "string"
}
]
}创建或更新关联配置
Create or update relation configuration
配置字段的关联规则,包括双向关联、级联策略等。 Configure field relation rules, including bidirectional, cascade strategy, etc.
| docType required | string |
| docId required | string |
| id required | string 配置ID Config id |
| sourceDocType required | string 源文档类型 Source document type |
| sourceDocId required | string 源文档ID Source document id |
| fieldId required | string 源字段ID Source field id |
| targetDocType required | string 目标文档类型 Target document type |
| targetDocId required | string 目标文档ID Target document id |
| bidirectional | boolean 是否双向关联 Bidirectional linking |
| reverseFieldId | string 反向字段ID(双向关联时使用) Reverse field id (for bidirectional) |
| cascadeDelete | string Enum: "none" "unlink" "soft" "hard" "prevent" 级联删除策略 Cascade delete strategy |
object 关联验证规则 Link validation rules | |
| createdAt | string 创建时间 Created at |
| updatedAt | string 更新时间 Updated at |
{- "id": "string",
- "sourceDocType": "string",
- "sourceDocId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "bidirectional": true,
- "reverseFieldId": "string",
- "cascadeDelete": "none",
- "validation": {
- "allowDuplicates": true,
- "maxLinks": 0,
- "minLinks": 0,
- "preventCircular": true
}, - "createdAt": "string",
- "updatedAt": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "sourceDocType": "string",
- "sourceDocId": "string",
- "fieldId": "string",
- "targetDocType": "string",
- "targetDocId": "string",
- "bidirectional": true,
- "reverseFieldId": "string",
- "cascadeDelete": "none",
- "validation": {
- "allowDuplicates": true,
- "maxLinks": 0,
- "minLinks": 0,
- "preventCircular": true
}, - "createdAt": "string",
- "updatedAt": "string"
}
}删除关联关系
Delete relation
删除指定的关联关系。如果是双向关联,会同时删除反向关联。 Delete specified relation. If bidirectional, also deletes reverse relation.
| docType required | string |
| docId required | string |
| relationId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}列出附件
List attachments
查询附件列表,支持过滤和分页。 Query attachments with filtering and pagination.
| organizationId | string |
| workspaceId | string |
| relatedDocType | string |
| relatedDocId | string |
| relatedRowId | string |
| mimeType | string |
| tags | string |
| createdBy | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "fileName": "string",
- "originalFileName": "string",
- "url": "string",
- "thumbnailUrl": "string",
- "previewUrl": "string",
- "downloadUrl": "string",
- "mimeType": "string",
- "size": 0,
- "extension": "string",
- "checksum": "string",
- "width": 0,
- "height": 0,
- "duration": 0,
- "version": 0,
- "parentVersionId": "string",
- "storageLocation": "string",
- "storageProvider": "local",
- "scanStatus": "pending",
- "scanResult": {
- "isSafe": true,
- "threats": [
- "string"
], - "scannedAt": "string"
}, - "organizationId": "string",
- "workspaceId": "string",
- "relatedDocType": "string",
- "relatedDocId": "string",
- "relatedRowId": "string",
- "relatedFieldId": "string",
- "tags": [
- "string"
], - "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "expiresAt": "string",
- "isPublic": true
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}清理过期附件
Clean expired attachments
清理已过期的临时附件。 Clean up expired temporary attachments.
| organizationId | string |
| dryRun | boolean |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "cleanedCount": 0,
- "freedSpace": 0,
- "cleanedAttachments": [
- "string"
]
}
}获取存储配额
Get storage quota
查询组织的存储配额使用情况。 Query organization storage quota usage.
| organizationId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "organizationId": "string",
- "totalQuota": 0,
- "usedQuota": 0,
- "remainingQuota": 0,
- "fileCount": 0,
- "updatedAt": "string"
}
}上传附件
Upload attachment
上传文件并返回附件信息。支持自动扫描和缩略图生成。 Upload file and return attachment info. Supports automatic scanning and thumbnail generation.
支持的参数:
file - 文件(必需)scanForVirus - 是否扫描病毒generateThumbnail - 是否生成缩略图generatePreview - 是否生成预览tags - 标签(逗号分隔)isPublic - 是否公开访问expiresIn - 过期时间(秒){- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "fileName": "string",
- "originalFileName": "string",
- "url": "string",
- "thumbnailUrl": "string",
- "previewUrl": "string",
- "downloadUrl": "string",
- "mimeType": "string",
- "size": 0,
- "extension": "string",
- "checksum": "string",
- "width": 0,
- "height": 0,
- "duration": 0,
- "version": 0,
- "parentVersionId": "string",
- "storageLocation": "string",
- "storageProvider": "local",
- "scanStatus": "pending",
- "scanResult": {
- "isSafe": true,
- "threats": [
- "string"
], - "scannedAt": "string"
}, - "organizationId": "string",
- "workspaceId": "string",
- "relatedDocType": "string",
- "relatedDocId": "string",
- "relatedRowId": "string",
- "relatedFieldId": "string",
- "tags": [
- "string"
], - "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "expiresAt": "string",
- "isPublic": true
}
}批量上传附件
Batch upload attachments
一次性上传多个文件。 Upload multiple files at once.
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "uploaded": [
- {
- "id": "string",
- "fileName": "string",
- "originalFileName": "string",
- "url": "string",
- "thumbnailUrl": "string",
- "previewUrl": "string",
- "downloadUrl": "string",
- "mimeType": "string",
- "size": 0,
- "extension": "string",
- "checksum": "string",
- "width": 0,
- "height": 0,
- "duration": 0,
- "version": 0,
- "parentVersionId": "string",
- "storageLocation": "string",
- "storageProvider": "local",
- "scanStatus": "pending",
- "scanResult": {
- "isSafe": true,
- "threats": [
- "string"
], - "scannedAt": "string"
}, - "organizationId": "string",
- "workspaceId": "string",
- "relatedDocType": "string",
- "relatedDocId": "string",
- "relatedRowId": "string",
- "relatedFieldId": "string",
- "tags": [
- "string"
], - "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "expiresAt": "string",
- "isPublic": true
}
], - "failures": [
- {
- "fileName": "string",
- "reason": "string"
}
]
}
}获取附件详情
Get attachment details
返回附件的完整信息。 Return complete attachment information.
| attachmentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "fileName": "string",
- "originalFileName": "string",
- "url": "string",
- "thumbnailUrl": "string",
- "previewUrl": "string",
- "downloadUrl": "string",
- "mimeType": "string",
- "size": 0,
- "extension": "string",
- "checksum": "string",
- "width": 0,
- "height": 0,
- "duration": 0,
- "version": 0,
- "parentVersionId": "string",
- "storageLocation": "string",
- "storageProvider": "local",
- "scanStatus": "pending",
- "scanResult": {
- "isSafe": true,
- "threats": [
- "string"
], - "scannedAt": "string"
}, - "organizationId": "string",
- "workspaceId": "string",
- "relatedDocType": "string",
- "relatedDocId": "string",
- "relatedRowId": "string",
- "relatedFieldId": "string",
- "tags": [
- "string"
], - "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "expiresAt": "string",
- "isPublic": true
}
}更新附件元数据
Update attachment metadata
更新附件的标签、名称等元数据。 Update attachment tags, name and other metadata.
| attachmentId required | string |
| fileName | string |
| tags | Array of strings |
| metadata | any |
| isPublic | boolean |
{- "fileName": "string",
- "tags": [
- "string"
], - "metadata": null,
- "isPublic": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "fileName": "string",
- "originalFileName": "string",
- "url": "string",
- "thumbnailUrl": "string",
- "previewUrl": "string",
- "downloadUrl": "string",
- "mimeType": "string",
- "size": 0,
- "extension": "string",
- "checksum": "string",
- "width": 0,
- "height": 0,
- "duration": 0,
- "version": 0,
- "parentVersionId": "string",
- "storageLocation": "string",
- "storageProvider": "local",
- "scanStatus": "pending",
- "scanResult": {
- "isSafe": true,
- "threats": [
- "string"
], - "scannedAt": "string"
}, - "organizationId": "string",
- "workspaceId": "string",
- "relatedDocType": "string",
- "relatedDocId": "string",
- "relatedRowId": "string",
- "relatedFieldId": "string",
- "tags": [
- "string"
], - "metadata": null,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "expiresAt": "string",
- "isPublic": true
}
}删除附件
Delete attachment
删除附件及其所有版本。此操作不可恢复。 Delete attachment and all its versions. This action is irreversible.
| attachmentId required | string |
| permanent | boolean |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取下载URL
Get download URL
生成附件的临时下载URL。 Generate temporary download URL for attachment.
| attachmentId required | string |
| expiresIn | integer <int64> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "downloadUrl": "string",
- "expiresAt": "string"
}
}获取预览URL
Get preview URL
生成附件的预览URL(支持图片、PDF等)。 Generate preview URL for attachment (supports images, PDF, etc).
| attachmentId required | string |
| size | string (Document.PreviewSize) Enum: "small" "medium" "large" "original" 预览尺寸 Preview size |
| page | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "previewUrl": "string",
- "expiresAt": "string"
}
}获取附件版本列表
Get attachment versions
返回附件的所有历史版本。 Return all historical versions of the attachment.
| attachmentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "attachmentId": "string",
- "version": 0,
- "size": 0,
- "checksum": "string",
- "url": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "note": "string"
}
]
}创建附件新版本
Create attachment version
为现有附件上传新版本。 Upload new version for existing attachment.
| attachmentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "attachmentId": "string",
- "version": 0,
- "size": 0,
- "checksum": "string",
- "url": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "note": "string"
}
}列出同步配置
List sync configurations
返回文档的所有同步配置。 Return all sync configurations of the document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "docType": "string",
- "docId": "string",
- "sourceType": "google_sheets",
- "sourceConfig": null,
- "syncMode": "one_way_import",
- "fieldMapping": [
- {
- "localFieldId": "string",
- "remoteFieldName": "string",
- "typeConversion": "string"
}
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "conflictResolution": "keep_local",
- "schedule": "string",
- "enabled": true,
- "incremental": true,
- "lastSyncedAt": "string",
- "nextSyncAt": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
]
}创建同步配置
Create sync configuration
创建新的数据同步配置。 Create new data sync configuration.
| docType required | string |
| docId required | string |
| id required | string 配置ID Config id |
| name required | string 名称 Name |
| description | string 描述 Description |
| docType required | string 文档类型 Document type |
| docId required | string 文档ID Document id |
| sourceType required | string Enum: "google_sheets" "excel_online" "csv" "json_api" "rest_api" "graphql_api" "database" "webhook" "airtable" "notion" 数据源类型 Source type |
| sourceConfig required | any 数据源配置 Source configuration 根据 sourceType 不同,配置内容不同。 Configuration varies by sourceType. |
| syncMode required | string Enum: "one_way_import" "one_way_export" "two_way" 同步模式 Sync mode |
Array of objects 字段映射 Field mapping 本地字段 -> 远程字段的映射。 Local field -> Remote field mapping. | |
object 同步过滤器 Sync filters 仅同步符合条件的数据。 Only sync data matching conditions. | |
| conflictResolution | string Enum: "keep_local" "keep_remote" "ask_user" "latest_wins" "merge" 冲突解决策略 Conflict resolution |
| schedule | string 定时任务(Cron 表达式) Schedule (Cron expression) 示例:
|
| enabled | boolean 是否启用 Enabled |
| incremental | boolean 增量同步(仅同步变更) Incremental sync |
| lastSyncedAt | string 最后同步时间 Last synced at |
| nextSyncAt | string 下次同步时间 Next sync at |
| createdAt | string 创建时间 Created at |
object 创建人 Created by | |
| updatedAt | string 更新时间 Updated at |
{- "id": "string",
- "name": "string",
- "description": "string",
- "docType": "string",
- "docId": "string",
- "sourceType": "google_sheets",
- "sourceConfig": null,
- "syncMode": "one_way_import",
- "fieldMapping": [
- {
- "localFieldId": "string",
- "remoteFieldName": "string",
- "typeConversion": "string"
}
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "conflictResolution": "keep_local",
- "schedule": "string",
- "enabled": true,
- "incremental": true,
- "lastSyncedAt": "string",
- "nextSyncAt": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "docType": "string",
- "docId": "string",
- "sourceType": "google_sheets",
- "sourceConfig": null,
- "syncMode": "one_way_import",
- "fieldMapping": [
- {
- "localFieldId": "string",
- "remoteFieldName": "string",
- "typeConversion": "string"
}
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "conflictResolution": "keep_local",
- "schedule": "string",
- "enabled": true,
- "incremental": true,
- "lastSyncedAt": "string",
- "nextSyncAt": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}测试同步连接
Test sync connection
测试与数据源的连接是否正常。 Test if connection to data source is working.
| docType required | string |
| docId required | string |
| sourceType required | string (Document.SyncSourceType) Enum: "google_sheets" "excel_online" "csv" "json_api" "rest_api" "graphql_api" "database" "webhook" "airtable" "notion" 同步源类型 Sync source type |
| sourceConfig required | any |
{- "sourceType": "google_sheets",
- "sourceConfig": null
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "success": true,
- "message": "string",
- "detectedFields": [
- {
- "name": "string",
- "type": "string"
}
]
}
}获取同步配置详情
Get sync configuration
返回指定同步配置的详细信息。 Return detailed information of specified sync configuration.
| docType required | string |
| docId required | string |
| configId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "docType": "string",
- "docId": "string",
- "sourceType": "google_sheets",
- "sourceConfig": null,
- "syncMode": "one_way_import",
- "fieldMapping": [
- {
- "localFieldId": "string",
- "remoteFieldName": "string",
- "typeConversion": "string"
}
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "conflictResolution": "keep_local",
- "schedule": "string",
- "enabled": true,
- "incremental": true,
- "lastSyncedAt": "string",
- "nextSyncAt": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}更新同步配置
Update sync configuration
更新同步配置的参数。 Update sync configuration parameters.
| docType required | string |
| docId required | string |
| configId required | string |
| id required | string 配置ID Config id |
| name required | string 名称 Name |
| description | string 描述 Description |
| docType required | string 文档类型 Document type |
| docId required | string 文档ID Document id |
| sourceType required | string Enum: "google_sheets" "excel_online" "csv" "json_api" "rest_api" "graphql_api" "database" "webhook" "airtable" "notion" 数据源类型 Source type |
| sourceConfig required | any 数据源配置 Source configuration 根据 sourceType 不同,配置内容不同。 Configuration varies by sourceType. |
| syncMode required | string Enum: "one_way_import" "one_way_export" "two_way" 同步模式 Sync mode |
Array of objects 字段映射 Field mapping 本地字段 -> 远程字段的映射。 Local field -> Remote field mapping. | |
object 同步过滤器 Sync filters 仅同步符合条件的数据。 Only sync data matching conditions. | |
| conflictResolution | string Enum: "keep_local" "keep_remote" "ask_user" "latest_wins" "merge" 冲突解决策略 Conflict resolution |
| schedule | string 定时任务(Cron 表达式) Schedule (Cron expression) 示例:
|
| enabled | boolean 是否启用 Enabled |
| incremental | boolean 增量同步(仅同步变更) Incremental sync |
| lastSyncedAt | string 最后同步时间 Last synced at |
| nextSyncAt | string 下次同步时间 Next sync at |
| createdAt | string 创建时间 Created at |
object 创建人 Created by | |
| updatedAt | string 更新时间 Updated at |
{- "id": "string",
- "name": "string",
- "description": "string",
- "docType": "string",
- "docId": "string",
- "sourceType": "google_sheets",
- "sourceConfig": null,
- "syncMode": "one_way_import",
- "fieldMapping": [
- {
- "localFieldId": "string",
- "remoteFieldName": "string",
- "typeConversion": "string"
}
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "conflictResolution": "keep_local",
- "schedule": "string",
- "enabled": true,
- "incremental": true,
- "lastSyncedAt": "string",
- "nextSyncAt": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "docType": "string",
- "docId": "string",
- "sourceType": "google_sheets",
- "sourceConfig": null,
- "syncMode": "one_way_import",
- "fieldMapping": [
- {
- "localFieldId": "string",
- "remoteFieldName": "string",
- "typeConversion": "string"
}
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "conflictResolution": "keep_local",
- "schedule": "string",
- "enabled": true,
- "incremental": true,
- "lastSyncedAt": "string",
- "nextSyncAt": "string",
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string"
}
}删除同步配置
Delete sync configuration
删除同步配置及其相关任务历史。 Delete sync configuration and its task history.
| docType required | string |
| docId required | string |
| configId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取同步冲突
Get sync conflicts
返回需要手动解决的同步冲突。 Return sync conflicts that need manual resolution.
| docType required | string |
| docId required | string |
| configId required | string |
| resolved | boolean |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "taskId": "string",
- "rowId": "string",
- "fieldId": "string",
- "localValue": null,
- "remoteValue": null,
- "localModifiedAt": "string",
- "remoteModifiedAt": "string",
- "resolution": "keep_local",
- "resolved": true,
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "resolvedAt": "string",
- "createdAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}解决同步冲突
Resolve sync conflict
手动解决同步冲突。 Manually resolve sync conflict.
| docType required | string |
| docId required | string |
| configId required | string |
| conflictId required | string |
| resolution required | string Enum: "keep_local" "keep_remote" "ask_user" "latest_wins" "merge" 解决策略 Resolution strategy |
| customValue | any 自定义值(当选择合并时) Custom value (when merge is selected) |
{- "resolution": "keep_local",
- "customValue": null
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "taskId": "string",
- "rowId": "string",
- "fieldId": "string",
- "localValue": null,
- "remoteValue": null,
- "localModifiedAt": "string",
- "remoteModifiedAt": "string",
- "resolution": "keep_local",
- "resolved": true,
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "resolvedAt": "string",
- "createdAt": "string"
}
}获取同步任务历史
Get sync task history
返回同步配置的执行历史。 Return execution history of sync configuration.
| docType required | string |
| docId required | string |
| configId required | string |
| status | string (Document.SyncTaskStatus) Enum: "pending" "running" "completed" "failed" "cancelled" "partial" 同步状态 Sync status |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "configId": "string",
- "status": "pending",
- "direction": "import",
- "startedAt": "string",
- "completedAt": "string",
- "recordsProcessed": 0,
- "recordsSucceeded": 0,
- "recordsFailed": 0,
- "recordsCreated": 0,
- "recordsUpdated": 0,
- "recordsDeleted": 0,
- "recordsConflicted": 0,
- "errorMessage": "string",
- "errorDetails": null,
- "logs": [
- "string"
], - "triggeredBy": "manual",
- "triggeredUser": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取任务详情
Get task details
返回同步任务的详细信息和日志。 Return detailed information and logs of sync task.
| docType required | string |
| docId required | string |
| configId required | string |
| taskId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "configId": "string",
- "status": "pending",
- "direction": "import",
- "startedAt": "string",
- "completedAt": "string",
- "recordsProcessed": 0,
- "recordsSucceeded": 0,
- "recordsFailed": 0,
- "recordsCreated": 0,
- "recordsUpdated": 0,
- "recordsDeleted": 0,
- "recordsConflicted": 0,
- "errorMessage": "string",
- "errorDetails": null,
- "logs": [
- "string"
], - "triggeredBy": "manual",
- "triggeredUser": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}取消同步任务
Cancel sync task
取消正在执行的同步任务。 Cancel running sync task.
| docType required | string |
| docId required | string |
| configId required | string |
| taskId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "configId": "string",
- "status": "pending",
- "direction": "import",
- "startedAt": "string",
- "completedAt": "string",
- "recordsProcessed": 0,
- "recordsSucceeded": 0,
- "recordsFailed": 0,
- "recordsCreated": 0,
- "recordsUpdated": 0,
- "recordsDeleted": 0,
- "recordsConflicted": 0,
- "errorMessage": "string",
- "errorDetails": null,
- "logs": [
- "string"
], - "triggeredBy": "manual",
- "triggeredUser": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}手动触发同步
Trigger sync manually
立即执行一次同步任务。 Execute sync task immediately.
| docType required | string |
| docId required | string |
| configId required | string |
| fullSync | boolean 是否完全同步(忽略增量设置) Full sync (ignore incremental setting) |
| dryRun | boolean 是否空运行(仅检查,不实际同步) Dry run (check only, don't actually sync) |
{- "fullSync": true,
- "dryRun": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "configId": "string",
- "status": "pending",
- "direction": "import",
- "startedAt": "string",
- "completedAt": "string",
- "recordsProcessed": 0,
- "recordsSucceeded": 0,
- "recordsFailed": 0,
- "recordsCreated": 0,
- "recordsUpdated": 0,
- "recordsDeleted": 0,
- "recordsConflicted": 0,
- "errorMessage": "string",
- "errorDetails": null,
- "logs": [
- "string"
], - "triggeredBy": "manual",
- "triggeredUser": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}列出指定位置的评论
List comments at specified location
支持按位置(文档/字段/行/单元格)过滤评论。 Supports filtering by location (document/field/row/cell).
查询参数示例:
scope=document - 文档级评论scope=field&fieldId=field-123 - 指定字段的评论scope=row&rowId=row-456 - 指定行的评论scope=cell&rowId=row-456&fieldId=field-123 - 指定单元格的评论parentId=comment-789 - 指定评论的回复Query examples:
scope=document - Document-level commentsscope=field&fieldId=field-123 - Comments on specific fieldscope=row&rowId=row-456 - Comments on specific rowscope=cell&rowId=row-456&fieldId=field-123 - Comments on specific cellparentId=comment-789 - Replies to specific comment| docType required | string |
| docId required | string |
| scope | string |
| fieldId | string |
| rowId | string |
| parentId | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建新评论
Create new comment
在指定位置创建评论。如果是回复,需指定 parentId。 Create a comment at specified location. Specify parentId if it's a reply.
示例 - 创建文档级评论 (Document-level comment):
{
"target": { "scope": "document" },
"content": "这是一条文档级评论"
}
示例 - 创建单元格评论 (Cell comment):
{
"target": { "scope": "cell", "rowId": "row-1", "fieldId": "name" },
"content": "这个单元格的数据看起来不对"
}
示例 - 创建回复 (Reply to comment):
{
"target": { "scope": "cell", "rowId": "row-1", "fieldId": "name" },
"parentId": "comment-original-1",
"content": "我同意,需要修正这个数据"
}
| docType required | string |
| docId required | string |
| id required | string 评论唯一标识 Unique identifier of the comment |
required | object 评论位置定位 Comment target location 指定评论在文档中的确切位置。 Specifies the exact location of the comment in the document. |
| parentId | string 父评论ID(如果是回复) Parent comment id (if this is a reply) 如果此评论是对另一条评论的回复,记录父评论ID。 If this comment is a reply to another, record the parent comment id. |
| content required | string 评论内容(支持富文本) Comment content (rich text supported) 支持 Markdown 格式和 HTML 标签。 Supports Markdown format and HTML tags. |
Array of objects (Common.UserRef) | |
Array of objects (Common.Attachment) 附件集合 Attachments 评论中附加的文件。 Files attached to the comment. | |
Array of objects (Document.Reaction) 表情反应集合 Emoji reactions 其他用户对此评论的表情反应。 Emoji reactions from other users to this comment. | |
| resolved | boolean 是否已解决 Resolved flag 标记此评论(及其讨论线程)是否已解决。 Mark if this comment (and its thread) is resolved. |
| resolvedAt | string 解决时间 Resolved at 评论解决的时间戳。 Timestamp when comment was resolved. |
object 解决人 Resolved by 解决此评论的人。 Who resolved this comment. | |
| pinned | boolean 是否置顶 Pinned flag 重要评论可以置顶展示。 Important comments can be pinned. |
| createdAt | string 创建时间 Created at |
object 创建人 Created by | |
| updatedAt | string 更新时间 Updated at |
object 更新人 Updated by | |
| replyCount | integer <int32> 回复数量 Reply count 此评论下的直接回复数(不包括递归回复)。 Direct reply count to this comment (not recursive). |
{- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}获取评论详情
Get comment detail
包括所有回复和反应信息。 Includes all replies and reactions.
| docType required | string |
| docId required | string |
| commentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}更新评论
Update comment
只有创建者或管理员可以编辑评论。 Only creator or admin can edit comment.
| docType required | string |
| docId required | string |
| commentId required | string |
| id required | string 评论唯一标识 Unique identifier of the comment |
required | object 评论位置定位 Comment target location 指定评论在文档中的确切位置。 Specifies the exact location of the comment in the document. |
| parentId | string 父评论ID(如果是回复) Parent comment id (if this is a reply) 如果此评论是对另一条评论的回复,记录父评论ID。 If this comment is a reply to another, record the parent comment id. |
| content required | string 评论内容(支持富文本) Comment content (rich text supported) 支持 Markdown 格式和 HTML 标签。 Supports Markdown format and HTML tags. |
Array of objects (Common.UserRef) | |
Array of objects (Common.Attachment) 附件集合 Attachments 评论中附加的文件。 Files attached to the comment. | |
Array of objects (Document.Reaction) 表情反应集合 Emoji reactions 其他用户对此评论的表情反应。 Emoji reactions from other users to this comment. | |
| resolved | boolean 是否已解决 Resolved flag 标记此评论(及其讨论线程)是否已解决。 Mark if this comment (and its thread) is resolved. |
| resolvedAt | string 解决时间 Resolved at 评论解决的时间戳。 Timestamp when comment was resolved. |
object 解决人 Resolved by 解决此评论的人。 Who resolved this comment. | |
| pinned | boolean 是否置顶 Pinned flag 重要评论可以置顶展示。 Important comments can be pinned. |
| createdAt | string 创建时间 Created at |
object 创建人 Created by | |
| updatedAt | string 更新时间 Updated at |
object 更新人 Updated by | |
| replyCount | integer <int32> 回复数量 Reply count 此评论下的直接回复数(不包括递归回复)。 Direct reply count to this comment (not recursive). |
{- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}删除评论
Delete comment
删除评论会同时删除其所有回复。 Deleting comment also deletes all its replies.
| docType required | string |
| docId required | string |
| commentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}置顶评论
Pin comment
将评论置顶,重要评论可以固定在顶部。 Pin important comments to the top.
| docType required | string |
| docId required | string |
| commentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}添加表情反应
Add emoji reaction
在评论上添加表情反应(如 👍、❤️ 等)。 Add emoji reaction to comment (e.g. 👍, ❤️).
| docType required | string |
| docId required | string |
| commentId required | string |
| emoji required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}移除表情反应
Remove emoji reaction
| docType required | string |
| docId required | string |
| commentId required | string |
| emoji required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}标记为已解决
Mark comment as resolved
标记评论及其讨论线程为已解决。 Mark comment and its discussion thread as resolved.
| docType required | string |
| docId required | string |
| commentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}取消置顶
Unpin comment
| docType required | string |
| docId required | string |
| commentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}取消解决标记
Unresolved comment
| docType required | string |
| docId required | string |
| commentId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
}应用 Yjs 更新
Apply Yjs update
应用客户端的 Yjs 更新到服务器。 Apply client Yjs update to server.
注意:通常应该通过 WebSocket 发送更新,此 HTTP 接口用于备用场景。 Note: Updates should normally be sent via WebSocket. This HTTP endpoint is for fallback scenarios.
| docType required | string |
| docId required | string |
| update required | string Yjs 更新数据(Base64) Yjs update data (Base64) |
| clientVersion | integer <int64> 客户端版本 Client version |
{- "update": "string",
- "clientVersion": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "success": true,
- "version": 0,
- "serverTime": "string"
}
}更新 Awareness 状态
Update awareness state
更新用户的 awareness 状态(光标、选择等)。 Update user awareness state (cursor, selection, etc).
注意:通常应该通过 WebSocket 发送,此接口用于备用场景。 Note: Should normally be sent via WebSocket. This endpoint is for fallback scenarios.
| docType required | string |
| docId required | string |
| awareness required | any Awareness 状态 Awareness state |
{- "awareness": null
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取 WebSocket 连接信息
Get WebSocket connection info
返回 WebSocket 连接 URL 和认证令牌。 Return WebSocket connection URL and auth token.
客户端使用流程:
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "wsUrl": "string",
- "wsHost": "string",
- "wsPath": "string",
- "port": 0,
- "protocols": [
- "string"
], - "sseUrl": "string",
- "token": "string",
- "expiresAt": "string",
- "serverTime": "string"
}
}断开所有会话
Disconnect all sessions
强制断开文档的所有实时协作会话。 Force disconnect all realtime collaboration sessions of the document.
| docType required | string |
| docId required | string |
| reason | string 断开原因 Reason |
{- "reason": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "disconnectedCount": 0
}
}获取实时事件历史
Get realtime event history
返回文档的实时协作事件历史。 Return realtime collaboration event history of the document.
| docType required | string |
| docId required | string |
| eventType | string (Document.RealtimeEventType) Enum: "yjs_update" "awareness_update" "user_joined" "user_left" "cell_locked" "cell_unlocked" "cursor_moved" "selection_changed" "comment_added" "data_changed" 实时事件类型 Realtime event type |
| userId | string |
| startTime | string |
| endTime | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "type": "yjs_update",
- "docType": "string",
- "docId": "string",
- "userId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "sessionId": "string",
- "data": null,
- "timestamp": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}锁定单元格
Lock cell
请求锁定单元格以进行编辑。 Request cell lock for editing.
| docType required | string |
| docId required | string |
| rowId required | string 行ID Row id |
| fieldId required | string 字段ID Field id |
| duration | integer <int32> 锁定时长(秒) Lock duration in seconds |
| autoRenew | boolean 是否自动续期 Auto renew |
{- "rowId": "string",
- "fieldId": "string",
- "duration": 0,
- "autoRenew": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "rowId": "string",
- "fieldId": "string",
- "lockedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "sessionId": "string",
- "lockedAt": "string",
- "expiresAt": "string",
- "autoRenew": true
}
}获取当前锁定
Get current locks
返回文档的所有活跃锁定。 Return all active locks of the document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "rowId": "string",
- "fieldId": "string",
- "lockedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "sessionId": "string",
- "lockedAt": "string",
- "expiresAt": "string",
- "autoRenew": true
}
]
}获取 Yjs 文档快照
Get Yjs document snapshot
返回最新的 Yjs 文档快照,用于初始化客户端。 Return latest Yjs document snapshot for client initialization.
| docType required | string |
| docId required | string |
| version | integer <int64> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "docType": "string",
- "docId": "string",
- "stateVector": "string",
- "docUpdate": "string",
- "version": 0,
- "createdAt": "string",
- "size": 0
}
}保存 Yjs 文档快照
Save Yjs document snapshot
保存当前 Yjs 文档状态。通常由服务器定期调用。 Save current Yjs document state. Usually called periodically by server.
| docType required | string |
| docId required | string |
| stateVector required | string Yjs 状态向量(Base64) Yjs state vector (Base64) |
| docUpdate required | string Yjs 文档更新(Base64) Yjs document update (Base64) |
{- "stateVector": "string",
- "docUpdate": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "docType": "string",
- "docId": "string",
- "stateVector": "string",
- "docUpdate": "string",
- "version": 0,
- "createdAt": "string",
- "size": 0
}
}获取快照历史
Get snapshot history
返回文档的 Yjs 快照历史。 Return Yjs snapshot history of the document.
| docType required | string |
| docId required | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "docType": "string",
- "docId": "string",
- "stateVector": "string",
- "docUpdate": "string",
- "version": 0,
- "createdAt": "string",
- "size": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}解锁单元格
Unlock cell
释放单元格锁定。 Release cell lock.
| docType required | string |
| docId required | string |
| lockId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取在线用户列表
Get online users
返回当前文档的所有在线用户。 Return all online users of current document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "userId": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "displayName": "string",
- "avatarUrl": "string",
- "color": "string",
- "sessionId": "string",
- "joinedAt": "string",
- "lastActiveAt": "string",
- "awareness": null
}
]
}获取 WebSocket 消息格式 Get WebSocket message schema
返回客户端与服务端的消息帧模型以及可用的消息类型枚举。 Return client/server message frames and available message kinds.
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "clientMessage": {
- "kind": "auth",
- "seq": 0,
- "docType": "string",
- "docId": "string",
- "payload": null,
- "timestamp": "string"
}, - "serverMessage": {
- "kind": "auth",
- "seq": 0,
- "ack": 0,
- "sessionId": "string",
- "userId": "string",
- "payload": null,
- "timestamp": "string"
}, - "kinds": [
- "auth"
]
}
}获取审批流程定义或实例概述。
Get approval flow definition or instance overview.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}在文档上发起审批流程。
Start approval flow on the document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "status": "pending",
- "currentNode": "string",
- "history": [
- {
- "nodeId": "string",
- "actor": "string",
- "decision": "approve",
- "comment": "string",
- "timestamp": "string"
}
]
}
}获取审批实例详情。
Get approval instance detail.
| docType required | string |
| docId required | string |
| instanceId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "status": "pending",
- "currentNode": "string",
- "history": [
- {
- "nodeId": "string",
- "actor": "string",
- "decision": "approve",
- "comment": "string",
- "timestamp": "string"
}
]
}
}对审批实例进行通过或拒绝的决策。
Decide approval (approve or reject).
| docType required | string |
| docId required | string |
| instanceId required | string |
| result required | string (Common.ApprovalDecision) Enum: "approve" "reject" "request_changes" 审批决议 Approval decision |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "status": "pending",
- "currentNode": "string",
- "history": [
- {
- "nodeId": "string",
- "actor": "string",
- "decision": "approve",
- "comment": "string",
- "timestamp": "string"
}
]
}
}列出文档的未生效变更请求。
List uncommitted merge requests of the document.
| docType required | string |
| docId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
]
}创建新的合并请求以提交未生效变更。
Create a new merge request for uncommitted changes.
| docType required | string |
| docId required | string |
| id required | string 请求ID Request id 合并请求的唯一标识。 Unique identifier of the merge request. |
| title | string 标题 Title 合并请求标题。 Title of the merge request. |
| description | string 描述 Description 合并请求描述。 Description of the merge request. |
| status required | string Enum: "open" "merged" "closed" 状态 Status 当前状态:open/merged/closed。 Current status: open/merged/closed. |
object 作者 Author 创建者。 Author. | |
Array of objects (Common.UserRef) 评审人 Reviewers 评审人列表。 List of reviewers. | |
Array of objects (Common.UserRef) 贡献者 Contributors 对该请求添加或修改变更的所有用户。 All users who added or modified changes in this request. | |
Array of objects (Document.Change) 变更集 Changes 包含待合并的变更。支持数据行、属性、视图等多种类型的变更。 Contains changes to be merged. Supports data rows, properties, views, and other types. | |
| generatedRevisionId | string 生成的修订ID Generated revision id 当请求合并后,系统生成的修订ID。 Revision id generated when the request is merged. |
| createdAt | string 创建时间 Created at 创建时间戳。 Created timestamp. |
| updatedAt | string 更新时间 Updated at 更新时间戳。 Updated timestamp. |
| mergedAt | string 合并时间 Merged at 请求被合并的时间戳。 Timestamp when the request was merged. |
object 合并者 Merged by 执行合并操作的用户。 User who performed the merge. |
{- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}获取合并请求的详细信息。
Get merge request detail.
| docType required | string |
| docId required | string |
| reqId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "title": "string",
- "description": "string",
- "status": "open",
- "author": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "reviewers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "changes": [
- {
- "id": "string",
- "type": "string",
- "operation": "create",
- "targetId": "string",
- "data": null,
- "changedAt": "string",
- "changedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "generatedRevisionId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}检查合并请求与当前文档的冲突。
Check conflicts between merge request and current document.
| docType required | string |
| docId required | string |
| reqId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}将合并请求的变更应用到文档并生成修订。
Apply merge request changes to the document and generate revision.
当请求被合并时:
When request is merged:
请求体支持以下选项:
squash - 是否合并为单一变更(true/false)message - 合并消息deleteBranch - 合并后是否删除关联分支Request body supports:
squash - Whether to squash into single changemessage - Merge messagedeleteBranch - Delete associated branch after merge响应包含:
revisionId - 生成的修订IDversion - 修订版本号changesApplied - 应用的变更数量contributors - 所有贡献者列表Response includes:
revisionId - Generated revision idversion - Revision version numberchangesApplied - Number of applied changescontributors - List of all contributors| docType required | string |
| docId required | string |
| reqId required | string |
| message | string 合并消息 Merge message |
| squash | boolean 是否合并为单一变更 Squash into single change |
| deleteBranch | boolean 合并后是否删除关联分支 Delete branch after merge |
{- "message": "string",
- "squash": true,
- "deleteBranch": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "revisionId": "string",
- "version": 0,
- "changesApplied": 0,
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedAt": "string",
- "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}列出文档的修订历史
List document revisions
按时间逆序返回修订列表,支持分页。 Returns revisions in reverse chronological order, supports pagination.
查询参数:
page - 页码(默认1)pageSize - 每页数量(默认20)contributor - 按贡献者过滤search - 按标题或描述搜索Query parameters:
page - Page number (default 1)pageSize - Items per page (default 20)contributor - Filter by contributorsearch - Search by title or description| docType required | string |
| docId required | string |
| page | integer <int32> |
| pageSize | integer <int32> |
| contributor | string |
| search | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "version": 0,
- "requestId": "string",
- "title": "string",
- "description": "string",
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "rowsCreated": 0,
- "rowsUpdated": 0,
- "rowsDeleted": 0,
- "fieldsCreated": 0,
- "fieldsUpdated": 0,
- "fieldsDeleted": 0,
- "metadataChanges": 0,
- "settingsChanges": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "previousRevisionId": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}查询特定目标的变更历史
Query change history for specific target
查看某个特定对象(行/字段)在所有修订中的变更历史。 View change history of a specific object (row/field) across all revisions.
示例 - 查询某行的变更历史:
curl 'https://open.nexusbook.app/api/v1/doc/product/123/revisions/history?targetKind=row&rowId=row-1' \\
-H 'Authorization: Bearer TOKEN'
| docType required | string |
| docId required | string |
| targetKind required | string |
| rowId | string |
| fieldId | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取指定修订的完整详情
Get revision detail
返回修订的完整信息,包含所有操作和统计数据。 Returns complete revision information including all operations and statistics.
| docType required | string |
| docId required | string |
| revId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "version": 0,
- "requestId": "string",
- "title": "string",
- "description": "string",
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "rowsCreated": 0,
- "rowsUpdated": 0,
- "rowsDeleted": 0,
- "fieldsCreated": 0,
- "fieldsUpdated": 0,
- "fieldsDeleted": 0,
- "metadataChanges": 0,
- "settingsChanges": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "previousRevisionId": "string"
}
}比较两个修订之间的差异
Compare revisions
返回两个修订之间的所有差异,支持按目标类型过滤。 Returns all differences between two revisions, supports filtering by target type.
示例(cURL):
# 比较 rev-2 与 rev-1(base)的差异
curl 'https://open.nexusbook.app/api/v1/doc/product/123/revisions/rev-2/diff?base=rev-1' \\
-H 'Authorization: Bearer TOKEN'
| docType required | string |
| docId required | string |
| revId required | string |
| base | string |
| targetKind | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "baseRevisionId": "string",
- "targetRevisionId": "string",
- "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "added": 0,
- "modified": 0,
- "deleted": 0
}
}
}查看修订的变更操作列表
List operations in revision
分页返回修订中的所有变更操作,支持按操作类型过滤。 Returns all change operations in the revision, supports filtering by operation type.
| docType required | string |
| docId required | string |
| revId required | string |
| type | string |
| targetKind | string |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取修订的源请求
Get source request of revision
获取生成此修订的原始合并请求。 Get the original merge request that generated this revision.
| docType required | string |
| docId required | string |
| revId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}回滚到指定修订
Revert to revision
将文档回滚到指定修订的状态,创建一个新的修订记录此操作。 Revert document to specified revision state, creates a new revision recording this action.
注意:回滚操作本身会生成新的修订(类型为 "revert")。 Note: The revert action itself generates a new revision (type "revert").
| docType required | string |
| docId required | string |
| revId required | string |
| reason | string 回滚原因 Revert reason |
| selectiveTypes | Array of strings 选择性回滚 Selective revert 只回滚特定类型的变更(如只回滚行的变更,保留字段变更)。 Only revert specific types of changes (e.g., only row changes, keep field changes). |
{- "reason": "string",
- "selectiveTypes": [
- "string"
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "version": 0,
- "requestId": "string",
- "title": "string",
- "description": "string",
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "rowsCreated": 0,
- "rowsUpdated": 0,
- "rowsDeleted": 0,
- "fieldsCreated": 0,
- "fieldsUpdated": 0,
- "fieldsDeleted": 0,
- "metadataChanges": 0,
- "settingsChanges": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "previousRevisionId": "string"
}
}获取组织级文档聚合数据 Get organization document aggregate
一次性获取组织级文档的多种数据。需要是组织成员。 Get multiple types of data for organization-level document in one request. Requires organization membership.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/doc/policy/doc-456?include=metadata,views,data' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| docType required | string 文档类型 Document type |
| docId required | string 文档ID Document ID |
| include | string 包含的数据部分(逗号分隔) Included data parts (comma-separated) 可选值: properties, metadata, views, data, comments, revisions, settings Options: properties, metadata, views, data, comments, revisions, settings |
| viewId | string 视图ID View ID |
| page | integer <int32> 页码 Page number |
| pageSize | integer <int32> 每页数量 Page size |
| commentsLimit | integer <int32> 评论数量限制 Comments limit |
| revisionsLimit | integer <int32> 修订数量限制 Revisions limit |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "properties": {
- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}, - "metadata": {
- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
], - "properties": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
]
}, - "views": [
- {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
], - "data": {
- "items": [
- {
- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}, - "comments": [
- {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
], - "revisions": [
- {
- "id": "string",
- "version": 0,
- "requestId": "string",
- "title": "string",
- "description": "string",
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "rowsCreated": 0,
- "rowsUpdated": 0,
- "rowsDeleted": 0,
- "fieldsCreated": 0,
- "fieldsUpdated": 0,
- "fieldsDeleted": 0,
- "metadataChanges": 0,
- "settingsChanges": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "previousRevisionId": "string"
}
], - "settings": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}
}列出组织文档 List organization documents
获取组织下的所有文档列表。需要是组织成员。 Get the list of all documents under the organization. Requires organization membership.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/documents?docType=policy&page=1&pageSize=20' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| docType | string 文档类型过滤 Filter by document type |
| search | string 搜索关键词 Search keyword |
| createdBy | string 创建者过滤 Filter by creator |
| sort | string Default: "updatedAt" 排序字段 Sort field |
| direction | string (Common.Direction) Enum: "asc" "desc" 排序方向 Sort direction |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "docId": "string",
- "docType": "string",
- "title": "string",
- "description": "string",
- "scope": "organization",
- "organizationId": "string",
- "workspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取工作区级文档聚合数据 Get workspace document aggregate
一次性获取工作区级文档的多种数据。需要是工作区成员。 Get multiple types of data for workspace-level document in one request. Requires workspace membership.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/doc/purchaseOrder/doc-789?include=metadata,views,data' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
| docType required | string 文档类型 Document type |
| docId required | string 文档ID Document ID |
| include | string 包含的数据部分(逗号分隔) Included data parts (comma-separated) 可选值: properties, metadata, views, data, comments, revisions, settings Options: properties, metadata, views, data, comments, revisions, settings |
| viewId | string 视图ID View ID |
| page | integer <int32> 页码 Page number |
| pageSize | integer <int32> 每页数量 Page size |
| commentsLimit | integer <int32> 评论数量限制 Comments limit |
| revisionsLimit | integer <int32> 修订数量限制 Revisions limit |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "properties": {
- "id": "string",
- "docId": "string",
- "docType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "properties": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "version": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}, - "metadata": {
- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
], - "properties": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": true,
- "unique": true,
- "readOnly": true,
- "options": [
- "string"
], - "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "formula": "string",
- "lookup": {
- "relationFieldId": "string",
- "targetFieldId": "string"
}, - "rollup": {
- "relationFieldId": "string",
- "targetFieldId": "string",
- "agg": "count"
}, - "validations": [
- {
- "ruleType": "string",
- "config": null,
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
]
}, - "views": [
- {
- "id": "string",
- "name": "string",
- "type": "table",
- "displayFields": [
- "string"
], - "filters": {
- "logic": "and",
- "conditions": [
- {
- "field": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
], - "rangeStart": null,
- "rangeEnd": null
}
], - "groups": [
- { }
]
}, - "sorts": [
- {
- "field": "string",
- "direction": "asc"
}
], - "group": {
- "fields": [
- "string"
], - "aggregations": [
- {
- "kind": "count",
- "field": "string"
}
]
}, - "columnConfig": {
- "width": [
- {
- "fieldId": "string",
- "width": 0
}
], - "order": [
- "string"
], - "pinned": [
- "string"
], - "hidden": [
- "string"
]
}
}
], - "data": {
- "items": [
- {
- "id": "string",
- "values": [
- {
- "fieldId": "string",
- "value": "string"
}
], - "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "version": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}, - "comments": [
- {
- "id": "string",
- "target": {
- "scope": "string",
- "fieldId": "string",
- "rowId": "string"
}, - "parentId": "string",
- "content": "string",
- "mentions": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "attachments": [
- {
- "id": "string",
- "fileName": "string",
- "url": "string",
- "mimeType": "string",
- "size": 0,
- "checksum": "string",
- "width": 0,
- "height": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "reactions": [
- {
- "emoji": "string",
- "users": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "count": 0
}
], - "resolved": true,
- "resolvedAt": "string",
- "resolvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "pinned": true,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "replyCount": 0
}
], - "revisions": [
- {
- "id": "string",
- "version": 0,
- "requestId": "string",
- "title": "string",
- "description": "string",
- "contributors": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "mergedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "changes": [
- {
- "id": "string",
- "type": "string",
- "target": {
- "kind": "string",
- "rowId": "string",
- "fieldId": "string"
}, - "oldValue": null,
- "newValue": null,
- "operator": "string",
- "timestamp": "string",
- "note": "string"
}
], - "stats": {
- "rowsCreated": 0,
- "rowsUpdated": 0,
- "rowsDeleted": 0,
- "fieldsCreated": 0,
- "fieldsUpdated": 0,
- "fieldsDeleted": 0,
- "metadataChanges": 0,
- "settingsChanges": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "previousRevisionId": "string"
}
], - "settings": {
- "defaultViewId": "string",
- "sharing": {
- "publicLinkEnabled": true,
- "password": "string"
}, - "permissions": null,
- "retention": {
- "revisions": {
- "maxCount": 0,
- "maxDays": 0
}
}
}
}
}列出工作区文档 List workspace documents
获取工作区下的所有文档列表。需要是工作区成员。 Get the list of all documents under the workspace. Requires workspace membership.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/workspaces/ws-456/documents?docType=purchaseOrder&page=1&pageSize=20' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| workspaceId required | string 工作区ID Workspace ID |
| docType | string 文档类型过滤 Filter by document type |
| search | string 搜索关键词 Search keyword |
| createdBy | string 创建者过滤 Filter by creator |
| sort | string Default: "updatedAt" 排序字段 Sort field |
| direction | string (Common.Direction) Enum: "asc" "desc" 排序方向 Sort direction |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "docId": "string",
- "docType": "string",
- "title": "string",
- "description": "string",
- "scope": "organization",
- "organizationId": "string",
- "workspaceId": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建 Catalog Create catalog
在组织下创建新的产品目录。需要组织管理员或有权限的成员。 Create a new product catalog under organization. Requires organization admin or authorized member.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "电子产品目录",
"catalogType": "supplier",
"sharingEnabled": true
}'
| organizationId required | string 组织 ID Organization ID |
创建请求 Create request
| name required | string Catalog 名称 Catalog name |
| description | string Catalog 描述 Catalog description |
| catalogType required | string Enum: "supplier" "distributor" "manufacturer" "retail" Catalog 类型 Catalog type |
| docType | string Default: "catalog" 文档类型(默认为 "catalog") Document type (default: "catalog") |
| workspaceId | string 所属工作区 ID(可选,null 表示组织级别) Workspace ID (optional, null for organization-level) |
| sharingEnabled | boolean Default: false 是否启用分享 Enable sharing |
Array of objects (Document.Catalog.CatalogFieldDefinition) 自定义字段定义 Custom field definitions 不同行业的商品字段可能不一样,例如:
Different industries have different product fields:
| |
| views | Array of any 初始视图配置(可选) Initial view configurations (optional) |
{- "name": "string",
- "description": "string",
- "catalogType": "supplier",
- "docType": "catalog",
- "workspaceId": "string",
- "sharingEnabled": false,
- "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string"
}
], - "views": [
- null
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "catalogId": "string",
- "docType": "string",
- "name": "string",
- "description": "string",
- "catalogType": "supplier",
- "organizationId": "string",
- "workspaceId": "string",
- "sharingEnabled": true,
- "sharingSettings": {
- "allowedTypes": [
- "public"
], - "defaultShareScope": "string"
}, - "productCount": 0,
- "activeConnections": [
- "string"
], - "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}列出组织的 Catalog List organization catalogs
获取组织下的所有 Catalog 列表。 Get list of all catalogs under organization.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs?catalogType=supplier&page=1&pageSize=20' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| workspaceId | string 工作区 ID 过滤(可选) Filter by workspace ID |
| catalogType | string (Document.Catalog.CatalogType) Enum: "supplier" "distributor" "manufacturer" "retail" Catalog 类型过滤 Filter by catalog type |
| search | string 搜索关键词 Search keyword |
| sharingEnabled | boolean 仅显示启用分享的 Catalog Show only sharing-enabled catalogs |
| sort | string Default: "updatedAt" 排序字段 Sort field |
| direction | string (Common.Direction) Enum: "asc" "desc" 排序方向 Sort direction |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "catalogId": "string",
- "name": "string",
- "description": "string",
- "catalogType": "supplier",
- "organizationId": "string",
- "workspaceId": "string",
- "sharingEnabled": true,
- "productCount": 0,
- "activeConnectionCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取 Catalog 详情 Get catalog details
获取指定 Catalog 的详细信息。 Get detailed information of specified catalog.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| catalogId required | string Catalog ID Catalog ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "catalogId": "string",
- "docType": "string",
- "name": "string",
- "description": "string",
- "catalogType": "supplier",
- "organizationId": "string",
- "workspaceId": "string",
- "sharingEnabled": true,
- "sharingSettings": {
- "allowedTypes": [
- "public"
], - "defaultShareScope": "string"
}, - "productCount": 0,
- "activeConnections": [
- "string"
], - "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}更新 Catalog Update catalog
更新 Catalog 的基本信息和设置。 Update catalog basic information and settings.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "更新后的产品目录",
"sharingEnabled": true
}'
| organizationId required | string 组织 ID Organization ID |
| catalogId required | string Catalog ID Catalog ID |
更新请求 Update request
| name | string Catalog 名称 Catalog name |
| description | string Catalog 描述 Catalog description |
| catalogType | string Enum: "supplier" "distributor" "manufacturer" "retail" Catalog 类型 Catalog type |
| sharingEnabled | boolean 是否启用分享 Enable sharing |
object 分享设置 Sharing settings |
{- "name": "string",
- "description": "string",
- "catalogType": "supplier",
- "sharingEnabled": true,
- "sharingSettings": {
- "allowedTypes": [
- "public"
], - "defaultShareScope": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "catalogId": "string",
- "docType": "string",
- "name": "string",
- "description": "string",
- "catalogType": "supplier",
- "organizationId": "string",
- "workspaceId": "string",
- "sharingEnabled": true,
- "sharingSettings": {
- "allowedTypes": [
- "public"
], - "defaultShareScope": "string"
}, - "productCount": 0,
- "activeConnections": [
- "string"
], - "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}删除 Catalog Delete catalog
删除指定的 Catalog。如果 Catalog 有活跃的 Connection,需要先删除或禁用 Connection。 Delete specified catalog. If catalog has active connections, must delete or disable connections first.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| catalogId required | string Catalog ID Catalog ID |
| force | boolean Default: false 强制删除(即使有活跃的 Connection) Force delete (even if has active connections) |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取 Catalog 字段定义 Get catalog field definitions
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456/fields' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string |
| catalogId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string"
}
]
}添加 Catalog 字段 Add catalog field
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456/fields' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "品牌",
"type": "text",
"required": true
}'
| organizationId required | string |
| catalogId required | string |
| id | string 字段 ID(可选,创建时不提供) Field ID (optional, not provided on creation) |
| name required | string 字段名称 Field name |
| type required | string Enum: "text" "long_text" "number" "currency" "percent" "date" "datetime" "boolean" "single_select" "multi_select" "attachment" "user" "relation" 字段类型 Field type |
| required | boolean Default: false 是否必填 Required |
| unique | boolean Default: false 是否唯一 Unique |
| readOnly | boolean Default: false 是否只读 Read only |
| defaultValue | any 默认值 Default value |
Array of objects (Common.SelectOption) 选择类字段的选项(type=single_select 或 multi_select 时) Select options (when type=single_select or multi_select) | |
| description | string 字段描述 Field description |
{- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string"
}
}更新 Catalog 字段 Update catalog field
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456/fields/field-789' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"required": false
}'
| organizationId required | string |
| catalogId required | string |
| fieldId required | string |
| id | string 字段 ID(可选,创建时不提供) Field ID (optional, not provided on creation) |
| name required | string 字段名称 Field name |
| type required | string Enum: "text" "long_text" "number" "currency" "percent" "date" "datetime" "boolean" "single_select" "multi_select" "attachment" "user" "relation" 字段类型 Field type |
| required | boolean Default: false 是否必填 Required |
| unique | boolean Default: false 是否唯一 Unique |
| readOnly | boolean Default: false 是否只读 Read only |
| defaultValue | any 默认值 Default value |
Array of objects (Common.SelectOption) 选择类字段的选项(type=single_select 或 multi_select 时) Select options (when type=single_select or multi_select) | |
| description | string 字段描述 Field description |
{- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string"
}
}删除 Catalog 字段 Delete catalog field
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456/fields/field-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string |
| catalogId required | string |
| fieldId required | string |
| force | boolean Default: false |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取 Catalog 的产品统计 Get catalog product statistics
获取 Catalog 中产品的统计信息。 Get product statistics of catalog.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/catalogs/catalog-456/stats' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| catalogId required | string Catalog ID Catalog ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "totalProducts": 0,
- "activeProducts": 0,
- "sharedProducts": 0,
- "connectionCount": 0,
- "activeConnectionCount": 0,
- "byCategory": {
- "property1": {
- "count": 0,
- "percentage": 0.1
}, - "property2": {
- "count": 0,
- "percentage": 0.1
}
}, - "lastUpdatedAt": "string"
}
}创建 OrderBook Create orderbook
可以基于已连接的 Connection 创建,自动生成字段定义和初始数据。 Can create based on connected Connections, auto-generating field definitions and initial data.
示例(cURL):
# 基于 Connection 创建
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/orderbooks' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "我的订货本",
"sourceConnectionIds": ["conn-456", "conn-789"]
}'
| organizationId required | string |
| name required | string OrderBook 名称 OrderBook name |
| description | string OrderBook 描述 OrderBook description |
| docType | string Default: "orderbook" 文档类型(默认为 "orderbook") Document type (default: "orderbook") |
| workspaceId | string 所属工作区 ID(可选,null 表示组织级别) Workspace ID (optional, null for organization-level) |
| sourceConnectionIds | Array of strings 基于已连接的 Connection 创建 Create based on connected connections 如果提供,将从这些 Connection 的源 Catalog 自动生成字段定义和初始数据。 If provided, will auto-generate field definitions and initial data from source Catalogs. |
Array of objects (Document.OrderBook.OrderBookFieldDefinition) 自定义字段定义(可选) Custom field definitions (optional) 如果提供 sourceConnectionIds,会与源字段合并。 If sourceConnectionIds provided, will merge with source fields. | |
| views | Array of any 初始视图配置(可选) Initial view configurations (optional) |
{- "name": "string",
- "description": "string",
- "docType": "orderbook",
- "workspaceId": "string",
- "sourceConnectionIds": [
- "string"
], - "fields": [
- {
- "id": "string",
- "name": "string",
- "type": "text",
- "required": false,
- "unique": false,
- "readOnly": false,
- "defaultValue": null,
- "selectOptions": [
- {
- "id": "string",
- "label": "string",
- "color": "string",
- "disabled": true
}
], - "description": "string",
- "sourceFieldId": "string",
- "sourceCatalogId": "string"
}
], - "views": [
- null
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "orderBookId": "string",
- "docType": "string",
- "name": "string",
- "description": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "productCount": 0,
- "activeConnections": [
- "string"
], - "sourceSuppliers": [
- {
- "organizationId": "string",
- "name": "string",
- "connectionId": "string",
- "productCount": 0
}
], - "canShareAsCatalog": true,
- "catalogConnectionCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}列出 OrderBook List orderbooks
| organizationId required | string |
| workspaceId | string |
| search | string |
| canShareAsCatalog | boolean |
| sort | string Default: "updatedAt" |
| direction | string (Common.Direction) Enum: "asc" "desc" |
| page | integer <int32> Default: 1 |
| pageSize | integer <int32> Default: 20 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "orderBookId": "string",
- "name": "string",
- "description": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "productCount": 0,
- "activeConnectionCount": 0,
- "sourceSupplierCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取 OrderBook 详情 Get orderbook details
| organizationId required | string |
| orderBookId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "orderBookId": "string",
- "docType": "string",
- "name": "string",
- "description": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "productCount": 0,
- "activeConnections": [
- "string"
], - "sourceSuppliers": [
- {
- "organizationId": "string",
- "name": "string",
- "connectionId": "string",
- "productCount": 0
}
], - "canShareAsCatalog": true,
- "catalogConnectionCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}更新 OrderBook Update orderbook
| organizationId required | string |
| orderBookId required | string |
| name | string OrderBook 名称 OrderBook name |
| description | string OrderBook 描述 OrderBook description |
| canShareAsCatalog | boolean 能否作为 Catalog 分享 Can be shared as catalog |
{- "name": "string",
- "description": "string",
- "canShareAsCatalog": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "orderBookId": "string",
- "docType": "string",
- "name": "string",
- "description": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "productCount": 0,
- "activeConnections": [
- "string"
], - "sourceSuppliers": [
- {
- "organizationId": "string",
- "name": "string",
- "connectionId": "string",
- "productCount": 0
}
], - "canShareAsCatalog": true,
- "catalogConnectionCount": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}删除 OrderBook Delete orderbook
| organizationId required | string |
| orderBookId required | string |
| force | boolean Default: false |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}创建 Connection Binding Create connection binding
将 OrderBook 与 Connection 建立 Binding 关系,配置字段映射和过滤条件。 Establish a Binding relationship between OrderBook and Connection, configuring field mapping and filter conditions.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/orderbooks/orderbook-456/bindings' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"connectionId": "conn-789",
"fieldMapping": {
"rules": [
{
"sourceFieldId": "src-field-1",
"targetFieldId": "tgt-field-1",
"transformType": "direct"
}
],
"unmappedFields": "create"
},
"receiverFilter": {
"acceptMode": "auto"
}
}'
| organizationId required | string |
| orderBookId required | string |
| connectionId required | string Connection ID Connection ID |
| targetOrderBookId required | string 目标 OrderBook ID Target OrderBook ID |
object 接收方过滤配置(Inbound 配置) Receiver filter (Inbound config) | |
object 字段映射配置(Inbound 配置) Field mapping (Inbound config) | |
object 冲突解决配置(Inbound 配置) Conflict resolution (Inbound config) |
{- "connectionId": "string",
- "targetOrderBookId": "string",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "targetOrderBookType": "string",
- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "requestedAt": "string",
- "requestedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedAt": "string",
- "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activatedAt": "string",
- "lastSyncTime": "string",
- "lastSyncRevisionId": "string",
- "syncStatus": "up_to_date"
}
}列出 OrderBook 的 Binding List orderbook bindings
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/orderbooks/orderbook-456/bindings' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string |
| orderBookId required | string |
| status | string (Document.Connection.BindingStatus) Enum: "pending" "active" "paused" "rejected" ConnectionBinding 状态枚举 ConnectionBinding status enum |
| page | integer <int32> Default: 1 |
| pageSize | integer <int32> Default: 20 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "bindingStatus": "pending",
- "requestedAt": "string",
- "activatedAt": "string",
- "lastSyncTime": "string",
- "syncStatus": "up_to_date"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}更新 Binding Update binding
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/orderbooks/orderbook-456/bindings/binding-999' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"bindingStatus": "active"
}'
| organizationId required | string |
| orderBookId required | string |
| bindingId required | string |
| bindingStatus | string Enum: "pending" "active" "paused" "rejected" Binding 状态 Binding status |
object 接收方过滤配置 Receiver filter | |
object 字段映射配置 Field mapping | |
object 冲突解决配置 Conflict resolution |
{- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "targetOrderBookType": "string",
- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "requestedAt": "string",
- "requestedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedAt": "string",
- "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activatedAt": "string",
- "lastSyncTime": "string",
- "lastSyncRevisionId": "string",
- "syncStatus": "up_to_date"
}
}删除 Binding Delete binding
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/orderbooks/orderbook-456/bindings/binding-999' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string |
| orderBookId required | string |
| bindingId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}预览字段映射 Preview field mapping
根据源 Catalog 和目标 OrderBook 的字段,生成建议的字段映射规则。 Generate suggested field mapping rules based on source Catalog and target OrderBook fields.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/orderbooks/orderbook-456/field-mapping/preview' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"connectionId": "conn-789"
}'
| organizationId required | string |
| orderBookId required | string |
| connectionId required | string Connection ID Connection ID |
{- "connectionId": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "suggestedMappings": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "sourceFields": [
- {
- "id": "string",
- "name": "string",
- "type": "string"
}
], - "targetFields": [
- {
- "id": "string",
- "name": "string",
- "type": "string"
}
], - "unmappedSourceFields": [
- "string"
], - "unmappedTargetFields": [
- "string"
]
}
}获取行来源信息 Get row source information
| organizationId required | string |
| orderBookId required | string |
| rowId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "sourceType": "connection",
- "sourceConnectionId": "string",
- "sourceCatalogId": "string",
- "sourceRowId": "string",
- "sourceOrganizationId": "string",
- "mergedSourceIds": [
- "string"
], - "lastSyncedAt": "string"
}
}获取 OrderBook 统计 Get orderbook statistics
| organizationId required | string |
| orderBookId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "totalProducts": 0,
- "activeProducts": 0,
- "sourceSupplierCount": 0,
- "connectionCount": 0,
- "activeConnectionCount": 0,
- "bySource": {
- "property1": {
- "count": 0,
- "percentage": 0.1
}, - "property2": {
- "count": 0,
- "percentage": 0.1
}
}, - "lastUpdatedAt": "string"
}
}列出组织的 Inbound Binding List organization's inbound bindings
| organizationId required | string |
| targetOrderBookId | string |
| bindingStatus | string (Document.Connection.BindingStatus) Enum: "pending" "active" "paused" "rejected" ConnectionBinding 状态枚举 ConnectionBinding status enum |
| sourceOrganizationId | string |
| page | integer <int32> Default: 1 |
| pageSize | integer <int32> Default: 20 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "bindingStatus": "pending",
- "requestedAt": "string",
- "activatedAt": "string",
- "lastSyncTime": "string",
- "syncStatus": "up_to_date"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建 Connection Create connection
| organizationId required | string |
| name required | string Connection 名称 Connection name |
| description | string Connection 描述 Connection description |
| sourceCatalogId required | string 源 Catalog ID Source catalog ID |
| shareMode required | string Enum: "single" "multiple" "public" 分享模式 Share mode |
required | object 访问控制配置 Access control |
required | object 分享范围配置 Share scope |
object 默认接收方配置 Default receiver config | |
object 传播事件配置 Propagation events |
{- "name": "string",
- "description": "string",
- "sourceCatalogId": "string",
- "shareMode": "single",
- "accessControl": {
- "mode": "whitelist",
- "allowedOrganizations": [
- "string"
], - "allowedUsers": [
- "string"
], - "deniedOrganizations": [
- "string"
], - "requireApproval": true,
- "approvers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
]
}, - "shareScope": {
- "mode": "all",
- "viewId": "string",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "defaultReceiverConfig": {
- "suggestedFieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "suggestedConflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "suggestedAcceptMode": "auto"
}, - "propagationEvents": {
- "eventTypes": [
- "string"
], - "batchMerge": true,
- "batchWindowSeconds": 0
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "sourceCatalogId": "string",
- "sourceCatalogType": "string",
- "sourceOrganizationId": "string",
- "shareMode": "single",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "accessControl": {
- "mode": "whitelist",
- "allowedOrganizations": [
- "string"
], - "allowedUsers": [
- "string"
], - "deniedOrganizations": [
- "string"
], - "requireApproval": true,
- "approvers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
]
}, - "shareScope": {
- "mode": "all",
- "viewId": "string",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "defaultReceiverConfig": {
- "suggestedFieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "suggestedConflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "suggestedAcceptMode": "auto"
}, - "propagationEvents": {
- "eventTypes": [
- "string"
], - "batchMerge": true,
- "batchWindowSeconds": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "lastSyncAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activeBindings": [
- {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "bindingStatus": "pending",
- "requestedAt": "string",
- "activatedAt": "string",
- "lastSyncTime": "string",
- "syncStatus": "up_to_date"
}
]
}
}列出 Connection List connections
| organizationId required | string |
| sourceCatalogId | string |
| shareMode | string (Document.Connection.ShareMode) Enum: "single" "multiple" "public" 分享模式枚举 Share mode enum |
| status | string (Document.Connection.ConnectionStatus) Enum: "active" "paused" "disabled" Connection 状态枚举 Connection status enum |
| search | string |
| sort | string Default: "createdAt" |
| direction | string (Common.Direction) Enum: "asc" "desc" |
| page | integer <int32> Default: 1 |
| pageSize | integer <int32> Default: 20 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "sourceCatalogId": "string",
- "sourceCatalogName": "string",
- "sourceOrganizationId": "string",
- "shareMode": "single",
- "status": "active",
- "activeBindingCount": 0,
- "createdAt": "string",
- "lastSyncAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取 Connection 详情 Get connection details
| organizationId required | string |
| connectionId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "sourceCatalogId": "string",
- "sourceCatalogType": "string",
- "sourceOrganizationId": "string",
- "shareMode": "single",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "accessControl": {
- "mode": "whitelist",
- "allowedOrganizations": [
- "string"
], - "allowedUsers": [
- "string"
], - "deniedOrganizations": [
- "string"
], - "requireApproval": true,
- "approvers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
]
}, - "shareScope": {
- "mode": "all",
- "viewId": "string",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "defaultReceiverConfig": {
- "suggestedFieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "suggestedConflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "suggestedAcceptMode": "auto"
}, - "propagationEvents": {
- "eventTypes": [
- "string"
], - "batchMerge": true,
- "batchWindowSeconds": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "lastSyncAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activeBindings": [
- {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "bindingStatus": "pending",
- "requestedAt": "string",
- "activatedAt": "string",
- "lastSyncTime": "string",
- "syncStatus": "up_to_date"
}
]
}
}更新 Connection Update connection
| organizationId required | string |
| connectionId required | string |
| name | string Connection 名称 Connection name |
| description | string Connection 描述 Connection description |
| status | string Enum: "active" "paused" "disabled" Connection 状态 Connection status |
object 访问控制配置 Access control | |
object 分享范围配置 Share scope | |
object 默认接收方配置 Default receiver config | |
object 传播事件配置 Propagation events |
{- "name": "string",
- "description": "string",
- "status": "active",
- "accessControl": {
- "mode": "whitelist",
- "allowedOrganizations": [
- "string"
], - "allowedUsers": [
- "string"
], - "deniedOrganizations": [
- "string"
], - "requireApproval": true,
- "approvers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
]
}, - "shareScope": {
- "mode": "all",
- "viewId": "string",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "defaultReceiverConfig": {
- "suggestedFieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "suggestedConflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "suggestedAcceptMode": "auto"
}, - "propagationEvents": {
- "eventTypes": [
- "string"
], - "batchMerge": true,
- "batchWindowSeconds": 0
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "sourceCatalogId": "string",
- "sourceCatalogType": "string",
- "sourceOrganizationId": "string",
- "shareMode": "single",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "accessControl": {
- "mode": "whitelist",
- "allowedOrganizations": [
- "string"
], - "allowedUsers": [
- "string"
], - "deniedOrganizations": [
- "string"
], - "requireApproval": true,
- "approvers": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
]
}, - "shareScope": {
- "mode": "all",
- "viewId": "string",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "defaultReceiverConfig": {
- "suggestedFieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "suggestedConflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "suggestedAcceptMode": "auto"
}, - "propagationEvents": {
- "eventTypes": [
- "string"
], - "batchMerge": true,
- "batchWindowSeconds": 0
}, - "createdAt": "string",
- "updatedAt": "string",
- "lastSyncAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activeBindings": [
- {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "bindingStatus": "pending",
- "requestedAt": "string",
- "activatedAt": "string",
- "lastSyncTime": "string",
- "syncStatus": "up_to_date"
}
]
}
}删除 Connection Delete connection
| organizationId required | string |
| connectionId required | string |
| force | boolean Default: false |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}创建 ConnectionBinding Create connection binding
| organizationId required | string |
| connectionId required | string |
| connectionId required | string Connection ID Connection ID |
| targetOrderBookId required | string 目标 OrderBook ID Target OrderBook ID |
object 接收方过滤配置(Inbound 配置) Receiver filter (Inbound config) | |
object 字段映射配置(Inbound 配置) Field mapping (Inbound config) | |
object 冲突解决配置(Inbound 配置) Conflict resolution (Inbound config) |
{- "connectionId": "string",
- "targetOrderBookId": "string",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "targetOrderBookType": "string",
- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "requestedAt": "string",
- "requestedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedAt": "string",
- "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activatedAt": "string",
- "lastSyncTime": "string",
- "lastSyncRevisionId": "string",
- "syncStatus": "up_to_date"
}
}列出 Connection 的 Binding List connection bindings
| organizationId required | string |
| connectionId required | string |
| bindingStatus | string (Document.Connection.BindingStatus) Enum: "pending" "active" "paused" "rejected" ConnectionBinding 状态枚举 ConnectionBinding status enum |
| targetOrganizationId | string |
| page | integer <int32> Default: 1 |
| pageSize | integer <int32> Default: 20 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "bindingStatus": "pending",
- "requestedAt": "string",
- "activatedAt": "string",
- "lastSyncTime": "string",
- "syncStatus": "up_to_date"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取 Binding 详情 Get binding details
| organizationId required | string |
| connectionId required | string |
| bindingId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "targetOrderBookType": "string",
- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "requestedAt": "string",
- "requestedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedAt": "string",
- "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activatedAt": "string",
- "lastSyncTime": "string",
- "lastSyncRevisionId": "string",
- "syncStatus": "up_to_date"
}
}更新 ConnectionBinding Update connection binding
| organizationId required | string |
| connectionId required | string |
| bindingId required | string |
| bindingStatus | string Enum: "pending" "active" "paused" "rejected" Binding 状态 Binding status |
object 接收方过滤配置 Receiver filter | |
object 字段映射配置 Field mapping | |
object 冲突解决配置 Conflict resolution |
{- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "targetOrderBookType": "string",
- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "requestedAt": "string",
- "requestedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedAt": "string",
- "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activatedAt": "string",
- "lastSyncTime": "string",
- "lastSyncRevisionId": "string",
- "syncStatus": "up_to_date"
}
}删除 ConnectionBinding Delete connection binding
| organizationId required | string |
| connectionId required | string |
| bindingId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}审批 ConnectionBinding Approve connection binding
| organizationId required | string |
| connectionId required | string |
| bindingId required | string |
| action required | string Enum: "approve" "reject" |
| comment | string |
{- "action": "approve",
- "comment": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectionId": "string",
- "bindingDirection": "outbound",
- "targetOrganizationId": "string",
- "targetOrderBookId": "string",
- "targetOrderBookType": "string",
- "bindingStatus": "pending",
- "receiverFilter": {
- "filterGroup": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "acceptMode": "auto",
- "manualAcceptRules": {
- "requireApprovalIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoRejectIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "autoAcceptIf": {
- "operator": "AND",
- "conditions": [
- {
- "fieldId": "string",
- "operator": "eq",
- "value": null,
- "values": [
- null
]
}
], - "groups": [
- { }
]
}, - "defaultAction": "accept"
}, - "maxAcceptCount": 0,
- "deduplicationStrategy": "none",
- "deduplicationFieldIds": [
- "string"
]
}, - "fieldMapping": {
- "rules": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "direct",
- "optionMapping": {
- "mappings": {
- "property1": "string",
- "property2": "string"
}, - "unmappedStrategy": "ignore",
- "defaultValue": "string"
}, - "unitConversion": {
- "sourceUnit": "string",
- "targetUnit": "string",
- "conversionType": "currency",
- "customRate": 0.1,
- "exchangeRateSource": "fixed",
- "fixedRate": 0.1
}, - "formatConfig": {
- "template": "string",
- "dateFormat": "string",
- "precision": 0,
- "caseConversion": "upper"
}, - "mergeConfig": {
- "sourceFieldIds": [
- "string"
], - "separator": " ",
- "template": "string"
}, - "splitConfig": {
- "separator": "string",
- "targetIndex": 0,
- "regex": "string"
}, - "formula": "string",
- "propagationMode": "oneway",
- "enabled": true,
- "description": "string"
}
], - "unmappedFields": "ignore"
}, - "conflictResolution": {
- "defaultStrategy": "keep_upstream",
- "fieldStrategies": {
- "property1": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}, - "property2": {
- "strategy": "keep_upstream",
- "mergeRules": {
- "type": "sum",
- "customLogic": "string"
}
}
}
}, - "requestedAt": "string",
- "requestedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "approvedAt": "string",
- "approvedBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "activatedAt": "string",
- "lastSyncTime": "string",
- "lastSyncRevisionId": "string",
- "syncStatus": "up_to_date"
}
}手动触发同步 Manually trigger sync
| organizationId required | string |
| connectionId required | string |
| forceFullSync | boolean |
| bindingIds | Array of strings |
{- "forceFullSync": true,
- "bindingIds": [
- "string"
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "syncTaskId": "string",
- "affectedBindingCount": 0,
- "startedAt": "string"
}
}获取同步状态 Get sync status
| organizationId required | string |
| connectionId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "connectionId": "string",
- "lastSyncTime": "string",
- "totalBindingCount": 0,
- "activeBindingCount": 0,
- "syncStatusStats": {
- "upToDate": 0,
- "pending": 0,
- "syncing": 0,
- "failed": 0
}, - "recentSyncTasks": [
- {
- "taskId": "string",
- "startedAt": "string",
- "completedAt": "string",
- "status": "running",
- "affectedRows": 0
}
]
}
}创建 Connector Create connector
在组织内创建文档之间的联动关系。需要有源文档和目标文档的访问权限。 Create linkage between documents within organization. Requires access to both source and target documents.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "主商品库到分店商品库",
"connectorType": "catalog_clone",
"sourceDocId": "catalog-main-001",
"targetDocId": "catalog-branch-001",
"catalogCloneConfig": {
"syncMode": "full",
"syncDirection": "one_way",
"linkedScope": {"mode": "all"},
"localEnhancements": {
"allowLocalAdd": true,
"allowLocalDelete": true,
"allowLocalModify": true
},
"conflictResolution": {"defaultStrategy": "keep_upstream"}
}
}'
| organizationId required | string 组织 ID Organization ID |
创建请求 Create request
| name required | string Connector 名称 Connector name |
| description | string Connector 描述 Connector description |
| connectorType required | string Enum: "catalog_clone" "orderbook_to_catalog" Connector 类型 Connector type |
| sourceDocId required | string 源文档 ID Source document ID |
| targetDocId required | string 目标文档 ID Target document ID |
| workspaceId | string 所属工作区 ID(可选,null 表示组织级别) Workspace ID (optional, null for organization-level) |
object Catalog 复制配置(connectorType=catalog_clone 时) Catalog clone config (when connectorType=catalog_clone) | |
object OrderBook 转 Catalog 配置(connectorType=orderbook_to_catalog 时) OrderBook to Catalog config (when connectorType=orderbook_to_catalog) |
{- "name": "string",
- "description": "string",
- "connectorType": "catalog_clone",
- "sourceDocId": "string",
- "targetDocId": "string",
- "workspaceId": "string",
- "catalogCloneConfig": {
- "syncMode": "full",
- "syncDirection": "one_way",
- "linkedScope": {
- "mode": "all",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "localEnhancements": {
- "allowLocalAdd": true,
- "allowLocalDelete": true,
- "allowLocalModify": true,
- "nonLinkedFields": [
- "string"
]
}, - "fieldMapping": null,
- "conflictResolution": null
}, - "orderbookToCatalogConfig": {
- "transformRules": {
- "filterGroup": null,
- "fieldTransforms": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "copy",
- "transformConfig": {
- "formula": "string",
- "lookupTable": {
- "property1": null,
- "property2": null
}, - "constantValue": null
}
}
], - "aggregationRules": [
- {
- "fieldId": "string",
- "aggregationType": "sum",
- "groupByField": "string"
}
]
}, - "syncTrigger": {
- "mode": "manual",
- "autoTriggerOn": [
- "string"
], - "schedule": "string"
}, - "conflictResolution": null
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "connectorType": "catalog_clone",
- "sourceDocId": "string",
- "sourceDocType": "string",
- "targetDocId": "string",
- "targetDocType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "catalogCloneConfig": {
- "syncMode": "full",
- "syncDirection": "one_way",
- "linkedScope": {
- "mode": "all",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "localEnhancements": {
- "allowLocalAdd": true,
- "allowLocalDelete": true,
- "allowLocalModify": true,
- "nonLinkedFields": [
- "string"
]
}, - "fieldMapping": null,
- "conflictResolution": null
}, - "orderbookToCatalogConfig": {
- "transformRules": {
- "filterGroup": null,
- "fieldTransforms": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "copy",
- "transformConfig": {
- "formula": "string",
- "lookupTable": {
- "property1": null,
- "property2": null
}, - "constantValue": null
}
}
], - "aggregationRules": [
- {
- "fieldId": "string",
- "aggregationType": "sum",
- "groupByField": "string"
}
]
}, - "syncTrigger": {
- "mode": "manual",
- "autoTriggerOn": [
- "string"
], - "schedule": "string"
}, - "conflictResolution": null
}, - "createdAt": "string",
- "updatedAt": "string",
- "lastSyncAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}列出组织的 Connector List organization connectors
获取组织下的所有 Connector 列表。 Get list of all connectors under organization.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors?connectorType=catalog_clone&status=active' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| workspaceId | string 工作区 ID 过滤 Filter by workspace ID |
| connectorType | string (Document.Connector.ConnectorType) Enum: "catalog_clone" "orderbook_to_catalog" Connector 类型过滤 Filter by connector type |
| sourceDocId | string 源文档 ID 过滤 Filter by source document ID |
| targetDocId | string 目标文档 ID 过滤 Filter by target document ID |
| status | string (Document.Connector.ConnectorStatus) Enum: "active" "paused" "disabled" Connector 状态过滤 Filter by connector status |
| search | string 搜索关键词 Search keyword |
| sort | string Default: "updatedAt" 排序字段 Sort field |
| direction | string (Common.Direction) Enum: "asc" "desc" 排序方向 Sort direction |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "connectorType": "catalog_clone",
- "sourceDocId": "string",
- "targetDocId": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "createdAt": "string",
- "lastSyncAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取 Connector 详情 Get connector details
获取指定 Connector 的详细信息。 Get detailed information of specified connector.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "connectorType": "catalog_clone",
- "sourceDocId": "string",
- "sourceDocType": "string",
- "targetDocId": "string",
- "targetDocType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "catalogCloneConfig": {
- "syncMode": "full",
- "syncDirection": "one_way",
- "linkedScope": {
- "mode": "all",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "localEnhancements": {
- "allowLocalAdd": true,
- "allowLocalDelete": true,
- "allowLocalModify": true,
- "nonLinkedFields": [
- "string"
]
}, - "fieldMapping": null,
- "conflictResolution": null
}, - "orderbookToCatalogConfig": {
- "transformRules": {
- "filterGroup": null,
- "fieldTransforms": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "copy",
- "transformConfig": {
- "formula": "string",
- "lookupTable": {
- "property1": null,
- "property2": null
}, - "constantValue": null
}
}
], - "aggregationRules": [
- {
- "fieldId": "string",
- "aggregationType": "sum",
- "groupByField": "string"
}
]
}, - "syncTrigger": {
- "mode": "manual",
- "autoTriggerOn": [
- "string"
], - "schedule": "string"
}, - "conflictResolution": null
}, - "createdAt": "string",
- "updatedAt": "string",
- "lastSyncAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}更新 Connector Update connector
更新 Connector 的配置信息。 Update connector configuration.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"status": "paused"
}'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
更新请求 Update request
| name | string Connector 名称 Connector name |
| description | string Connector 描述 Connector description |
| status | string Enum: "active" "paused" "disabled" Connector 状态 Connector status |
object Catalog 复制配置 Catalog clone config | |
object OrderBook 转 Catalog 配置 OrderBook to Catalog config |
{- "name": "string",
- "description": "string",
- "status": "active",
- "catalogCloneConfig": {
- "syncMode": "full",
- "syncDirection": "one_way",
- "linkedScope": {
- "mode": "all",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "localEnhancements": {
- "allowLocalAdd": true,
- "allowLocalDelete": true,
- "allowLocalModify": true,
- "nonLinkedFields": [
- "string"
]
}, - "fieldMapping": null,
- "conflictResolution": null
}, - "orderbookToCatalogConfig": {
- "transformRules": {
- "filterGroup": null,
- "fieldTransforms": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "copy",
- "transformConfig": {
- "formula": "string",
- "lookupTable": {
- "property1": null,
- "property2": null
}, - "constantValue": null
}
}
], - "aggregationRules": [
- {
- "fieldId": "string",
- "aggregationType": "sum",
- "groupByField": "string"
}
]
}, - "syncTrigger": {
- "mode": "manual",
- "autoTriggerOn": [
- "string"
], - "schedule": "string"
}, - "conflictResolution": null
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "connectorType": "catalog_clone",
- "sourceDocId": "string",
- "sourceDocType": "string",
- "targetDocId": "string",
- "targetDocType": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "catalogCloneConfig": {
- "syncMode": "full",
- "syncDirection": "one_way",
- "linkedScope": {
- "mode": "all",
- "filterGroup": null,
- "rowIds": [
- "string"
]
}, - "localEnhancements": {
- "allowLocalAdd": true,
- "allowLocalDelete": true,
- "allowLocalModify": true,
- "nonLinkedFields": [
- "string"
]
}, - "fieldMapping": null,
- "conflictResolution": null
}, - "orderbookToCatalogConfig": {
- "transformRules": {
- "filterGroup": null,
- "fieldTransforms": [
- {
- "sourceFieldId": "string",
- "targetFieldId": "string",
- "transformType": "copy",
- "transformConfig": {
- "formula": "string",
- "lookupTable": {
- "property1": null,
- "property2": null
}, - "constantValue": null
}
}
], - "aggregationRules": [
- {
- "fieldId": "string",
- "aggregationType": "sum",
- "groupByField": "string"
}
]
}, - "syncTrigger": {
- "mode": "manual",
- "autoTriggerOn": [
- "string"
], - "schedule": "string"
}, - "conflictResolution": null
}, - "createdAt": "string",
- "updatedAt": "string",
- "lastSyncAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
}
}删除 Connector Delete connector
删除指定的 Connector。删除后,联动关系将被解除。 Delete specified connector. After deletion, linkage will be removed.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
| deleteLinkedData | boolean Default: false 是否删除目标文档中的联动数据 Delete linked data in target document |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}列出 LinkedRow List linked rows
获取 Connector 的所有联动行记录。 Get all linked row records of connector.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456/linked-rows' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
| linkStatus | string Enum: "active" "broken" "paused" 联动状态过滤 Filter by link status |
| sourceRowId | string 源行 ID 过滤 Filter by source row ID |
| targetRowId | string 目标行 ID 过滤 Filter by target row ID |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "connectorId": "string",
- "sourceDocId": "string",
- "sourceRowId": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "linkStatus": "active",
- "lastSyncedAt": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取 LinkedRow 详情 Get linked row details
获取指定联动行的详细信息。 Get detailed information of specified linked row.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456/linked-rows/link-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
| linkId required | string Link ID Link ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "connectorId": "string",
- "sourceDocId": "string",
- "sourceRowId": "string",
- "targetDocId": "string",
- "targetRowId": "string",
- "linkStatus": "active",
- "lastSyncedAt": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
}删除 LinkedRow Delete linked row
删除指定的联动行记录,解除源行和目标行的联动关系。 Delete specified linked row record, remove linkage between source and target rows.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456/linked-rows/link-789' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
| linkId required | string Link ID Link ID |
| deleteTargetRow | boolean Default: false 是否删除目标行 Delete target row |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": null
}获取 Connector 统计信息 Get connector statistics
获取 Connector 的统计信息。 Get connector statistics.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456/stats' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "totalLinkedRows": 0,
- "activeLinks": 0,
- "brokenLinks": 0,
- "lastSyncedAt": "string",
- "syncStats": {
- "totalSyncs": 0,
- "successCount": 0,
- "failureCount": 0
}
}
}触发 Connector 同步 Trigger connector sync
手动触发 Connector 的数据同步。 Manually trigger connector data synchronization.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/connectors/connector-456/sync' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织 ID Organization ID |
| connectorId required | string Connector ID Connector ID |
| fullSync | boolean Default: false 是否全量同步 Full sync |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "taskId": "string",
- "status": "string",
- "startedAt": "string"
}
}{- "issuer": "string",
- "authorization_endpoint": "string",
- "token_endpoint": "string",
- "userinfo_endpoint": "string",
- "jwks_uri": "string",
- "scopes_supported": [
- "string"
], - "response_types_supported": [
- "string"
], - "grant_types_supported": [
- "string"
], - "id_token_signing_alg_values_supported": [
- "string"
], - "claims_supported": [
- "string"
]
}颁发访问令牌与刷新令牌。
Issue access and refresh tokens.
示例(cURL):
curl -X POST 'https://auth.nexusbook.app/token' \\
-H 'Content-Type: application/x-www-form-urlencoded' \\
-d 'grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&scope=doc:read data:read'
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "access_token": "string",
- "token_type": "Bearer",
- "expires_in": 0,
- "refresh_token": "string",
- "scope": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "sub": "string",
- "name": "string",
- "given_name": "string",
- "family_name": "string",
- "middle_name": "string",
- "nickname": "string",
- "preferred_username": "string",
- "profile": "string",
- "picture": "string",
- "website": "string",
- "email": "string",
- "email_verified": true,
- "gender": "string",
- "birthdate": "string",
- "zoneinfo": "string",
- "locale": "string",
- "phone_number": "string",
- "phone_number_verified": true,
- "address": {
- "formatted": "string",
- "street_address": "string",
- "locality": "string",
- "region": "string",
- "postal_code": "string",
- "country": "string"
}, - "updated_at": 0,
- "roles": [
- "string"
], - "tenants": [
- "string"
]
}
}修改密码 Change password
修改当前用户的密码(需要认证)。 Change current user's password (requires authentication).
| currentPassword required | string 当前密码 Current password |
| newPassword required | string 新密码 New password |
{- "currentPassword": "string",
- "newPassword": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}请求密码重置 Request password reset
发送密码重置验证码。 Send password reset verification code.
| target required | string 邮箱或手机号 Email or phone number |
{- "target": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "sent": true,
- "expiresIn": 0
}
}用户登录 User login
支持多种登录方式:邮箱+密码、手机+验证码、OAuth。 Supports multiple login methods: email+password, phone+code, OAuth.
示例(邮箱登录):
curl -X POST 'https://open.nexusbook.app/api/v1/auth/login' \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"password": "SecurePassword123!",
"rememberMe": true
}'
string 邮箱 Email | |
| phone | string 手机号 Phone number |
| password | string 密码 Password |
| verificationCode | string 验证码(手机登录时使用) Verification code (for phone login) |
| authorizationCode | string OAuth 授权码(OAuth 登录时使用) OAuth authorization code (for OAuth login) |
| provider | string OAuth 提供商(OAuth 登录时使用) OAuth provider (for OAuth login) |
| twoFactorCode | string 两步验证码(如果启用了 2FA) Two-factor code (if 2FA enabled) |
| rememberMe | boolean 记住我(延长会话时间) Remember me (extend session) |
{- "email": "string",
- "phone": "string",
- "password": "string",
- "verificationCode": "string",
- "authorizationCode": "string",
- "provider": "string",
- "twoFactorCode": "string",
- "rememberMe": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "accessToken": "string",
- "refreshToken": "string",
- "tokenType": "Bearer",
- "expiresIn": 0,
- "user": {
- "id": "string",
- "email": "string",
- "phone": "string",
- "displayName": "string",
- "avatarUrl": "string"
}, - "requiresTwoFactor": true
}
}刷新令牌 Refresh token
使用刷新令牌获取新的访问令牌。 Use refresh token to get new access token.
| refreshToken required | string 刷新令牌 Refresh token |
{- "refreshToken": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "accessToken": "string",
- "refreshToken": "string",
- "expiresIn": 0
}
}用户注册 User registration
支持邮箱注册和手机号注册。 Supports email and phone registration.
示例(邮箱注册):
curl -X POST 'https://open.nexusbook.app/api/v1/auth/register' \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"password": "SecurePassword123!",
"displayName": "张三",
"agreeToTerms": true
}'
string 邮箱 Email | |
| phone | string 手机号 Phone number |
| password | string 密码(邮箱注册时必填) Password (required for email registration) |
| displayName required | string 显示名称 Display name |
| invitationCode | string 邀请码(可选) Invitation code (optional) |
| agreeToTerms required | boolean 同意服务条款 Agree to terms of service |
{- "email": "string",
- "phone": "string",
- "password": "string",
- "displayName": "string",
- "invitationCode": "string",
- "agreeToTerms": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "accessToken": "string",
- "refreshToken": "string",
- "tokenType": "Bearer",
- "expiresIn": 0,
- "user": {
- "id": "string",
- "email": "string",
- "phone": "string",
- "displayName": "string",
- "avatarUrl": "string"
}, - "requiresTwoFactor": true
}
}重置密码 Reset password
使用验证码重置密码。 Reset password using verification code.
| target required | string 邮箱或手机号 Email or phone number |
| verificationCode required | string 验证码 Verification code |
| newPassword required | string 新密码 New password |
{- "target": "string",
- "verificationCode": "string",
- "newPassword": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "userId": "string",
- "device": {
- "type": "string",
- "os": "string",
- "browser": "string"
}, - "ipAddress": "string",
- "location": {
- "country": "string",
- "city": "string"
}, - "createdAt": "string",
- "lastActiveAt": "string",
- "expiresAt": "string",
- "status": "active",
- "isCurrent": true
}
]
}禁用两步验证 Disable two-factor authentication
禁用当前用户的两步验证。 Disable two-factor authentication for current user.
| password required | string 当前密码或验证码 Current password or verification code |
{- "password": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}启用两步验证 Enable two-factor authentication
确认并启用两步验证。 Confirm and enable two-factor authentication.
| method required | string Enum: "totp" "sms" "email" "backupCode" 两步验证方式 Two-factor method |
| code required | string 验证码(用于确认) Verification code (for confirmation) |
{- "method": "totp",
- "code": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "enabled": true,
- "backupCodes": [
- "string"
]
}
}设置两步验证 Setup two-factor authentication
初始化两步验证设置,返回 TOTP 密钥或备用码。 Initialize two-factor setup, returns TOTP secret or backup codes.
| method required | string Enum: "totp" "sms" "email" "backupCode" 两步验证方式 Two-factor method |
{- "method": "totp"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "method": "totp",
- "secret": "string",
- "qrCodeUrl": "string",
- "backupCodes": [
- "string"
]
}
}发送验证码 Send verification code
发送验证码到邮箱或手机号。 Send verification code to email or phone.
| target required | string 邮箱或手机号 Email or phone number |
| type required | string Enum: "login" "register" "resetPassword" "enableTwoFactor" 验证码类型 Code type |
{- "target": "string",
- "type": "login"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "sent": true,
- "expiresIn": 0
}
}创建 API Key Create API Key
创建新的 API 密钥。密钥只在创建时返回完整内容,请妥善保存。 Create new API key. Full key is only returned on creation, please save it securely.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/api-keys' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "生产环境 API Key",
"description": "用于生产环境的后端服务",
"scopes": ["doc:read", "doc:write", "data:read", "data:write"],
"expiresInDays": 365,
"rateLimit": 1000
}'
| name required | string 名称 Name |
| description | string 描述 Description |
| scopes required | Array of strings (Auth.AuthScope) Items Enum: "doc:read" "doc:write" "doc:delete" "data:read" "data:write" "data:delete" "org:manage" "workspace:manage" "user:manage" "webhook:manage" "all" 权限范围 Scopes |
| organizationId | string 所属组织ID(可选) Organization ID (optional) |
| workspaceId | string 所属工作区ID(可选) Workspace ID (optional) |
| expiresInDays | integer <int32> 过期天数(不设置则永不过期) Expiration days (never expires if not set) |
| rateLimit | integer <int32> 速率限制(请求数/分钟) Rate limit (requests per minute) |
| ipWhitelist | Array of strings IP 白名单 IP whitelist |
| allowedOrigins | Array of strings 允许的来源(CORS) Allowed origins (CORS) |
{- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "organizationId": "string",
- "workspaceId": "string",
- "expiresInDays": 0,
- "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "key": "string",
- "keyPrefix": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "userId": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "createdAt": "string",
- "lastUsedAt": "string",
- "expiresAt": "string",
- "usageCount": 0,
- "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
]
}
}列出 API Keys List API Keys
获取当前用户的所有 API 密钥列表。 Get list of all API keys for current user.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/api-keys?page=1&pageSize=20&status=active' \
-H 'Authorization: Bearer TOKEN'
| page | integer <int32> Default: 1 页码(从1开始) Page number (starts from 1) |
| pageSize | integer <int32> Default: 20 每页数量 Page size |
| status | string (Auth.ApiKeyStatus) Enum: "active" "expired" "revoked" "disabled" 按状态筛选 Filter by status |
| organizationId | string 按组织ID筛选 Filter by organization ID |
| workspaceId | string 按工作区ID筛选 Filter by workspace ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "key": "string",
- "keyPrefix": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "userId": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "createdAt": "string",
- "lastUsedAt": "string",
- "expiresAt": "string",
- "usageCount": 0,
- "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
]
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}批量吊销 API Keys Batch revoke API Keys
批量吊销多个 API 密钥。 Batch revoke multiple API keys.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/api-keys/batch-revoke' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"apiKeyIds": ["key-1", "key-2", "key-3"]
}'
| apiKeyIds required | Array of strings API Key ID 列表 API Key ID list |
{- "apiKeyIds": [
- "string"
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "revokedCount": 0,
- "failed": [
- "string"
]
}
}获取 API Key 详情 Get API Key details
获取指定 API 密钥的详细信息(不包含完整密钥)。 Get details of specified API key (without full key).
| apiKeyId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "key": "string",
- "keyPrefix": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "userId": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "createdAt": "string",
- "lastUsedAt": "string",
- "expiresAt": "string",
- "usageCount": 0,
- "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
]
}
}更新 API Key Update API Key
更新 API 密钥的配置信息。 Update API key configuration.
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/api-keys/{apiKeyId}' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "生产环境 API Key (更新)",
"scopes": ["doc:read", "data:read"],
"rateLimit": 500
}'
| apiKeyId required | string |
| name | string 名称 Name |
| description | string 描述 Description |
| scopes | Array of strings (Auth.AuthScope) Items Enum: "doc:read" "doc:write" "doc:delete" "data:read" "data:write" "data:delete" "org:manage" "workspace:manage" "user:manage" "webhook:manage" "all" 权限范围 Scopes |
| rateLimit | integer <int32> 速率限制(请求数/分钟) Rate limit (requests per minute) |
| ipWhitelist | Array of strings IP 白名单 IP whitelist |
| allowedOrigins | Array of strings 允许的来源(CORS) Allowed origins (CORS) |
| enabled | boolean 启用/禁用 Enable/disable |
{- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
], - "enabled": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "key": "string",
- "keyPrefix": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "userId": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "createdAt": "string",
- "lastUsedAt": "string",
- "expiresAt": "string",
- "usageCount": 0,
- "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
]
}
}删除 API Key Delete API Key
彻底删除 API 密钥及其所有使用记录。 Permanently delete API key and all its usage logs.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/api-keys/{apiKeyId}' \
-H 'Authorization: Bearer TOKEN'
| apiKeyId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}获取 API Key 使用记录 Get API Key usage logs
获取 API 密钥的使用记录。 Get usage logs of API key.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/api-keys/{apiKeyId}/logs?page=1&pageSize=50&startTime=2024-12-01T00:00:00Z&endTime=2024-12-05T23:59:59Z' \
-H 'Authorization: Bearer TOKEN'
| apiKeyId required | string |
| page | integer <int32> Default: 1 页码 Page number |
| pageSize | integer <int32> Default: 50 每页数量 Page size |
| startTime | string 开始时间 Start time |
| endTime | string 结束时间 End time |
| method | string 按方法筛选 Filter by method |
| path | string 按路径筛选 Filter by path |
| statusCode | integer <int32> 按状态码筛选 Filter by status code |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "apiKeyId": "string",
- "timestamp": "string",
- "method": "string",
- "path": "string",
- "statusCode": 0,
- "ipAddress": "string",
- "userAgent": "string",
- "origin": "string",
- "responseTime": 0,
- "error": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}重新生成 API Key Regenerate API Key
重新生成 API 密钥。旧密钥立即失效,新密钥只返回一次。 Regenerate API key. Old key is immediately invalidated, new key is returned only once.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/api-keys/{apiKeyId}/regenerate' \
-H 'Authorization: Bearer TOKEN'
| apiKeyId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "key": "string",
- "keyPrefix": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "doc:read"
], - "userId": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "status": "active",
- "createdAt": "string",
- "lastUsedAt": "string",
- "expiresAt": "string",
- "usageCount": 0,
- "rateLimit": 0,
- "ipWhitelist": [
- "string"
], - "allowedOrigins": [
- "string"
]
}
}吊销 API Key Revoke API Key
永久吊销 API 密钥,吊销后无法恢复。 Permanently revoke API key, cannot be restored after revocation.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/api-keys/{apiKeyId}/revoke' \
-H 'Authorization: Bearer TOKEN'
| apiKeyId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": { }
}获取 API Key 使用统计 Get API Key usage statistics
获取 API 密钥的使用统计信息。 Get usage statistics of API key.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/api-keys/{apiKeyId}/stats?period=7d' \
-H 'Authorization: Bearer TOKEN'
| apiKeyId required | string |
| period | string Default: "7d" 统计周期(1h, 24h, 7d, 30d, 90d) Statistics period (1h, 24h, 7d, 30d, 90d) |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "apiKeyId": "string",
- "periodStart": "string",
- "periodEnd": "string",
- "totalRequests": 0,
- "successfulRequests": 0,
- "failedRequests": 0,
- "averageResponseTime": 0.1,
- "byEndpoint": [
- {
- "path": "string",
- "count": 0
}
], - "byStatusCode": [
- {
- "code": 0,
- "count": 0
}
]
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "planId": "string",
- "plan": {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}, - "status": "trialing",
- "trialStart": "string",
- "trialEnd": "string",
- "currentPeriodStart": "string",
- "currentPeriodEnd": "string",
- "cancelAt": "string",
- "canceledAt": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdAt": "string",
- "updatedAt": "string"
}
}创建或更新组织订阅
| organizationId required | string 组织 ID |
订阅请求
| planId required | string 计划 ID |
| billingCycle required | string Enum: "monthly" "yearly" 计费周期 |
| paymentMethodId | string 支付方式 ID |
{- "planId": "string",
- "billingCycle": "monthly",
- "paymentMethodId": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "planId": "string",
- "plan": {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}, - "status": "trialing",
- "trialStart": "string",
- "trialEnd": "string",
- "currentPeriodStart": "string",
- "currentPeriodEnd": "string",
- "cancelAt": "string",
- "canceledAt": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdAt": "string",
- "updatedAt": "string"
}
}取消订阅
| organizationId required | string 组织 ID |
取消请求
| cancelImmediately required | boolean 是否立即取消 |
| reason | string 取消原因 |
| feedback | string 反馈意见 |
{- "cancelImmediately": true,
- "reason": "string",
- "feedback": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "planId": "string",
- "plan": {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}, - "status": "trialing",
- "trialStart": "string",
- "trialEnd": "string",
- "currentPeriodStart": "string",
- "currentPeriodEnd": "string",
- "cancelAt": "string",
- "canceledAt": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdAt": "string",
- "updatedAt": "string"
}
}升级/降级订阅
| organizationId required | string 组织 ID |
变更计划请求
| targetPlanId required | string 目标计划 ID |
| billingCycle required | string Enum: "monthly" "yearly" 计费周期 |
| effectiveDate required | string Enum: "immediate" "next_billing_cycle" 生效日期 |
{- "targetPlanId": "string",
- "billingCycle": "monthly",
- "effectiveDate": "immediate"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "subscription": {
- "id": "string",
- "organizationId": "string",
- "planId": "string",
- "plan": {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}, - "status": "trialing",
- "trialStart": "string",
- "trialEnd": "string",
- "currentPeriodStart": "string",
- "currentPeriodEnd": "string",
- "cancelAt": "string",
- "canceledAt": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdAt": "string",
- "updatedAt": "string"
}, - "prorationAmount": 0.1,
- "nextBillingDate": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "planId": "string",
- "plan": {
- "id": "string",
- "name": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}, - "description": {
- "property1": "string",
- "property2": "string"
}, - "type": "trial",
- "billingCycle": "monthly",
- "price": 0.1,
- "currency": "string",
- "trialDays": 0,
- "features": [
- {
- "featureKey": "string",
- "featureName": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "limit": 0
}
], - "quotas": {
- "maxMembers": 0,
- "maxWorkspaces": 0,
- "maxDocuments": 0,
- "maxStorageGB": 0,
- "maxAPICallsPerMonth": 0,
- "maxRealtimeSessions": 0
}, - "status": "active",
- "createdAt": "string",
- "updatedAt": "string"
}, - "status": "trialing",
- "trialStart": "string",
- "trialEnd": "string",
- "currentPeriodStart": "string",
- "currentPeriodEnd": "string",
- "cancelAt": "string",
- "canceledAt": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdAt": "string",
- "updatedAt": "string"
}
}列出组织账单
| organizationId required | string 组织 ID |
| status | string (Billing.InvoiceStatus) Enum: "draft" "open" "paid" "void_status" "uncollectible" 按状态过滤 |
| page | integer <int32> Default: 1 页码 |
| pageSize | integer <int32> Default: 20 每页数量 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "organizationId": "string",
- "subscriptionId": "string",
- "invoiceNumber": "string",
- "status": "draft",
- "subtotal": 0.1,
- "tax": 0.1,
- "total": 0.1,
- "currency": "string",
- "items": [
- {
- "description": {
- "property1": "string",
- "property2": "string"
}, - "quantity": 0,
- "unitPrice": 0.1,
- "amount": 0.1,
- "type": "subscription"
}
], - "periodStart": "string",
- "periodEnd": "string",
- "dueDate": "string",
- "paidAt": "string",
- "paymentIntentId": "string",
- "invoiceUrl": "string",
- "invoicePdfUrl": "string",
- "createdAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取账单详情
| organizationId required | string 组织 ID |
| invoiceId required | string 账单 ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "subscriptionId": "string",
- "invoiceNumber": "string",
- "status": "draft",
- "subtotal": 0.1,
- "tax": 0.1,
- "total": 0.1,
- "currency": "string",
- "items": [
- {
- "description": {
- "property1": "string",
- "property2": "string"
}, - "quantity": 0,
- "unitPrice": 0.1,
- "amount": 0.1,
- "type": "subscription"
}
], - "periodStart": "string",
- "periodEnd": "string",
- "dueDate": "string",
- "paidAt": "string",
- "paymentIntentId": "string",
- "invoiceUrl": "string",
- "invoicePdfUrl": "string",
- "createdAt": "string"
}
}支付账单
| organizationId required | string 组织 ID |
| invoiceId required | string 账单 ID |
支付请求
| paymentMethodId required | string 支付方式 ID |
{- "paymentMethodId": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "invoice": {
- "id": "string",
- "organizationId": "string",
- "subscriptionId": "string",
- "invoiceNumber": "string",
- "status": "draft",
- "subtotal": 0.1,
- "tax": 0.1,
- "total": 0.1,
- "currency": "string",
- "items": [
- {
- "description": {
- "property1": "string",
- "property2": "string"
}, - "quantity": 0,
- "unitPrice": 0.1,
- "amount": 0.1,
- "type": "subscription"
}
], - "periodStart": "string",
- "periodEnd": "string",
- "dueDate": "string",
- "paidAt": "string",
- "paymentIntentId": "string",
- "invoiceUrl": "string",
- "invoicePdfUrl": "string",
- "createdAt": "string"
}, - "paymentStatus": "string",
- "requiresAction": true,
- "clientSecret": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "id": "string",
- "organizationId": "string",
- "type": "card",
- "isDefault": true,
- "cardLast4": "string",
- "cardBrand": "string",
- "expiryMonth": 0,
- "expiryYear": 0,
- "billingEmail": "string",
- "createdAt": "string"
}
]
}添加支付方式
| organizationId required | string 组织 ID |
添加请求
| type required | string Enum: "card" "alipay" "wechat" "bank_transfer" 支付类型 |
| paymentToken required | string 支付 Token(由支付网关生成) |
| setAsDefault | boolean 设为默认 |
{- "type": "card",
- "paymentToken": "string",
- "setAsDefault": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "type": "card",
- "isDefault": true,
- "cardLast4": "string",
- "cardBrand": "string",
- "expiryMonth": 0,
- "expiryYear": 0,
- "billingEmail": "string",
- "createdAt": "string"
}
}设置默认支付方式
| organizationId required | string 组织 ID |
| paymentMethodId required | string 支付方式 ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "type": "card",
- "isDefault": true,
- "cardLast4": "string",
- "cardBrand": "string",
- "expiryMonth": 0,
- "expiryYear": 0,
- "billingEmail": "string",
- "createdAt": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "organizationId": "string",
- "periodStart": "string",
- "periodEnd": "string",
- "members": {
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "isOverQuota": true
}, - "workspaces": {
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "isOverQuota": true
}, - "documents": {
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "isOverQuota": true
}, - "storage": {
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "isOverQuota": true
}, - "apiCalls": {
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "isOverQuota": true
}, - "realtimeSessions": {
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "isOverQuota": true
}, - "updatedAt": "string"
}
}获取使用量历史趋势
| organizationId required | string 组织 ID |
| metricType required | string (Billing.MetricType) Enum: "members" "workspaces" "documents" "storage_gb" "api_calls" "realtime_sessions" 指标类型 |
| startDate required | string 开始日期 |
| endDate required | string 结束日期 |
| granularity required | string Default: "day" Enum: "hour" "day" "month" 粒度(hour/day/month) |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "metricType": "members",
- "dataPoints": [
- {
- "timestamp": "string",
- "value": 0
}
]
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "warnings": [
- {
- "metricType": "members",
- "current": 0,
- "limit": 0,
- "percentage": 0.1,
- "severity": "warning",
- "message": {
- "property1": "string",
- "property2": "string"
}
}
]
}
}查询审计日志
| organizationId required | string 组织 ID |
| actorId | string 操作者 ID |
| actorType | string (Audit.ActorType) Enum: "user" "apikey" "system" "webhook" 操作者类型 |
| actionCategory | string (Audit.ActionCategory) Enum: "authentication" "authorization" "data_access" "data_modification" "configuration" "user_management" "permission_management" "billing" "security" "compliance" 操作分类 |
| actionName | string 操作名称 |
| resourceType | string (Audit.ResourceType) Enum: "user" "organization" "workspace" "document" "data_row" "view" "comment" "apikey" "webhook" "subscription" "invoice" 资源类型 |
| resourceId | string 资源 ID |
| resultStatus | string (Audit.ResultStatus) Enum: "success" "failure" "partial" 结果状态 |
| startDate | string 开始时间 |
| endDate | string 结束时间 |
| ipAddress | string IP 地址 |
| search | string 全文搜索 |
| page | integer <int32> Default: 1 页码 |
| pageSize | integer <int32> Default: 20 每页数量 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "actor": {
- "type": "user",
- "id": "string",
- "displayName": "string",
- "email": "string",
- "role": "string"
}, - "action": {
- "category": "authentication",
- "name": "string",
- "description": {
- "property1": "string",
- "property2": "string"
}
}, - "resource": {
- "type": "user",
- "id": "string",
- "name": "string",
- "parentType": "user",
- "parentId": "string"
}, - "result": {
- "status": "success",
- "errorCode": "BAD_USER_NAME",
- "errorMessage": {
- "property1": "string",
- "property2": "string"
}
}, - "changes": [
- {
- "field": "string",
- "oldValue": null,
- "newValue": null,
- "changeType": "create"
}
], - "context": {
- "ipAddress": "string",
- "userAgent": "string",
- "location": {
- "country": "string",
- "region": "string",
- "city": "string",
- "timezone": "string"
}, - "sessionId": "string",
- "requestId": "string"
}, - "timestamp": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建审计日志告警规则
| organizationId required | string 组织 ID |
告警规则请求
| name required | string 规则名称 |
| enabled required | boolean 是否启用 |
required | object 条件 |
required | object 动作 |
{- "name": "string",
- "enabled": true,
- "conditions": {
- "actionCategory": "authentication",
- "actionName": "string",
- "resultStatus": "success",
- "threshold": 0,
- "timeWindow": 0
}, - "actions": {
- "email": [
- "string"
], - "webhook": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "ruleId": "string",
- "name": "string",
- "enabled": true,
- "conditions": {
- "actionCategory": "authentication",
- "actionName": "string",
- "resultStatus": "success",
- "threshold": 0,
- "timeWindow": 0
}, - "actions": {
- "email": [
- "string"
], - "webhook": "string"
}, - "createdAt": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "ruleId": "string",
- "name": "string",
- "enabled": true,
- "conditions": {
- "actionCategory": "authentication",
- "actionName": "string",
- "resultStatus": "success",
- "threshold": 0,
- "timeWindow": 0
}, - "actions": {
- "email": [
- "string"
], - "webhook": "string"
}, - "createdAt": "string"
}
]
}导出审计日志
| organizationId required | string 组织 ID |
导出请求
| format required | string Enum: "csv" "json" "pdf" 导出格式 |
object 过滤条件 | |
| includeFields | Array of strings 包含字段 |
{- "format": "csv",
- "filters": {
- "startDate": "string",
- "endDate": "string",
- "actionCategory": "authentication"
}, - "includeFields": [
- "string"
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "exportId": "string",
- "status": "processing",
- "downloadUrl": "string",
- "expiresAt": "string"
}
}获取导出任务状态
| organizationId required | string 组织 ID |
| exportId required | string 导出任务 ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "exportId": "string",
- "status": "string",
- "progress": 0.1,
- "downloadUrl": "string",
- "expiresAt": "string"
}
}获取审计统计
| organizationId required | string 组织 ID |
| startDate | string 开始时间 |
| endDate | string 结束时间 |
| groupBy | string Enum: "action" "actor" "resource" 分组维度 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "totalEvents": 0,
- "successCount": 0,
- "failureCount": 0,
- "topActions": [
- {
- "actionName": "string",
- "count": 0
}
], - "topActors": [
- {
- "actorId": "string",
- "actorName": "string",
- "count": 0
}
], - "topResources": [
- {
- "resourceType": "user",
- "count": 0
}
], - "timeline": [
- {
- "timestamp": "string",
- "count": 0
}
]
}
}获取审计日志详情
| organizationId required | string 组织 ID |
| logId required | string 日志 ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "organizationId": "string",
- "workspaceId": "string",
- "actor": {
- "type": "user",
- "id": "string",
- "displayName": "string",
- "email": "string",
- "role": "string"
}, - "action": {
- "category": "authentication",
- "name": "string",
- "description": {
- "property1": "string",
- "property2": "string"
}
}, - "resource": {
- "type": "user",
- "id": "string",
- "name": "string",
- "parentType": "user",
- "parentId": "string"
}, - "result": {
- "status": "success",
- "errorCode": "BAD_USER_NAME",
- "errorMessage": {
- "property1": "string",
- "property2": "string"
}
}, - "changes": [
- {
- "field": "string",
- "oldValue": null,
- "newValue": null,
- "changeType": "create"
}
], - "context": {
- "ipAddress": "string",
- "userAgent": "string",
- "location": {
- "country": "string",
- "region": "string",
- "city": "string",
- "timezone": "string"
}, - "sessionId": "string",
- "requestId": "string"
}, - "timestamp": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
}获取数据访问记录(GDPR)
| organizationId required | string 组织 ID |
| userId | string 用户 ID |
| dataType | string 数据类型 |
| startDate | string 开始时间 |
| endDate | string 结束时间 |
| page | integer <int32> Default: 1 页码 |
| pageSize | integer <int32> Default: 20 每页数量 |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "timestamp": "string",
- "accessor": {
- "type": "user",
- "id": "string",
- "displayName": "string",
- "email": "string",
- "role": "string"
}, - "dataType": "string",
- "dataId": "string",
- "operation": "string",
- "purpose": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}生成合规性报告
| organizationId required | string 组织 ID |
报告请求
| reportType required | string Enum: "gdpr" "soc2" "hipaa" "custom" 报告类型 |
| periodStart required | string 周期开始 |
| periodEnd required | string 周期结束 |
| includeAccessLogs | boolean 包含访问日志 |
| includeDataChanges | boolean 包含数据变更 |
| includePermissionChanges | boolean 包含权限变更 |
{- "reportType": "gdpr",
- "periodStart": "string",
- "periodEnd": "string",
- "includeAccessLogs": true,
- "includeDataChanges": true,
- "includePermissionChanges": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "reportId": "string",
- "status": "generating",
- "downloadUrl": "string",
- "expiresAt": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "policies": [
- {
- "dataType": "string",
- "retentionDays": 0,
- "autoDeleteEnabled": true,
- "legalHoldExempt": true
}
]
}
}更新数据保留策略
| organizationId required | string 组织 ID |
策略请求
required | Array of objects (Audit.RetentionPolicy) 策略列表 |
{- "policies": [
- {
- "dataType": "string",
- "retentionDays": 0,
- "autoDeleteEnabled": true,
- "legalHoldExempt": true
}
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "policies": [
- {
- "dataType": "string",
- "retentionDays": 0,
- "autoDeleteEnabled": true,
- "legalHoldExempt": true
}
]
}
}列出所有 Webhook
List all webhooks
返回当前用户/租户的所有 Webhook 配置。 Returns all webhook configurations for current user/tenant.
| status | string (Extensions.Webhooks.WebhookStatus) Enum: "active" "paused" "failed" Webhook 状态 Webhook status |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}创建 Webhook
Create webhook
创建新的 Webhook 订阅。 Create a new webhook subscription.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/webhooks' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Request Merged Notification",
"url": "https://example.com/webhooks/nexusbook",
"events": ["request_merged", "approval_approved"],
"filters": {
"docTypes": ["product", "inventory"]
}
}'
| id required | string Webhook ID Webhook id |
| name required | string 名称 Name |
| description | string 描述 Description |
| url required | string 目标 URL Target URL 接收 Webhook 事件的 URL。 URL to receive webhook events. |
| events required | Array of strings (Extensions.Webhooks.WebhookEventType) Items Enum: "request_created" "request_merged" "request_closed" "request_reopened" "approval_started" "approval_approved" "approval_rejected" "approval_canceled" "approval_node_completed" "comment_created" "comment_updated" "comment_deleted" "comment_resolved" "comment_mentioned" "metadata_updated" "metadata_field_added" "metadata_field_updated" "metadata_field_deleted" "view_created" "view_updated" "view_deleted" "view_default_changed" "data_row_created" "data_row_updated" "data_row_deleted" "data_bulk_operation" "revision_created" "revision_reverted" 订阅的事件类型 Subscribed event types |
object 事件过滤条件 Event filters | |
| secret | string 密钥(用于签名验证) Secret (for signature verification) 用于生成 HMAC 签名,验证消息来源。 Used to generate HMAC signature for message verification. |
| status required | string Enum: "active" "paused" "failed" 状态 Status |
object 自定义请求头 Custom headers 发送 Webhook 请求时附加的自定义头。 Custom headers to include in webhook requests. | |
| timeout | integer <int32> 超时时间(秒) Timeout in seconds |
| maxRetries | integer <int32> 最大重试次数 Max retry attempts |
| retryInterval | integer <int32> 重试间隔(秒) Retry interval in seconds |
| createdAt | string 创建时间 Created at |
object 创建人 Created by | |
| updatedAt | string 更新时间 Updated at |
| lastTriggeredAt | string 最后触发时间 Last triggered at |
| triggerCount | integer <int64> 触发次数 Trigger count |
| failureCount | integer <int64> 失败次数 Failure count |
{- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}
}更新 Webhook
Update webhook
| webhookId required | string |
| id required | string Webhook ID Webhook id |
| name required | string 名称 Name |
| description | string 描述 Description |
| url required | string 目标 URL Target URL 接收 Webhook 事件的 URL。 URL to receive webhook events. |
| events required | Array of strings (Extensions.Webhooks.WebhookEventType) Items Enum: "request_created" "request_merged" "request_closed" "request_reopened" "approval_started" "approval_approved" "approval_rejected" "approval_canceled" "approval_node_completed" "comment_created" "comment_updated" "comment_deleted" "comment_resolved" "comment_mentioned" "metadata_updated" "metadata_field_added" "metadata_field_updated" "metadata_field_deleted" "view_created" "view_updated" "view_deleted" "view_default_changed" "data_row_created" "data_row_updated" "data_row_deleted" "data_bulk_operation" "revision_created" "revision_reverted" 订阅的事件类型 Subscribed event types |
object 事件过滤条件 Event filters | |
| secret | string 密钥(用于签名验证) Secret (for signature verification) 用于生成 HMAC 签名,验证消息来源。 Used to generate HMAC signature for message verification. |
| status required | string Enum: "active" "paused" "failed" 状态 Status |
object 自定义请求头 Custom headers 发送 Webhook 请求时附加的自定义头。 Custom headers to include in webhook requests. | |
| timeout | integer <int32> 超时时间(秒) Timeout in seconds |
| maxRetries | integer <int32> 最大重试次数 Max retry attempts |
| retryInterval | integer <int32> 重试间隔(秒) Retry interval in seconds |
| createdAt | string 创建时间 Created at |
object 创建人 Created by | |
| updatedAt | string 更新时间 Updated at |
| lastTriggeredAt | string 最后触发时间 Last triggered at |
| triggerCount | integer <int64> 触发次数 Trigger count |
| failureCount | integer <int64> 失败次数 Failure count |
{- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}
}获取投递历史
Get delivery history
查看 Webhook 的投递记录。 View webhook delivery records.
| webhookId required | string |
| status | string Enum: "pending" "success" "failed" "retrying" |
| page | integer <int32> |
| pageSize | integer <int32> |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "items": [
- {
- "id": "string",
- "webhookId": "string",
- "event": "request_created",
- "status": "pending",
- "url": "string",
- "requestBody": null,
- "responseStatus": 0,
- "responseBody": "string",
- "error": "string",
- "retryCount": 0,
- "deliveredAt": "string",
- "responseTime": 0,
- "createdAt": "string"
}
], - "page": 0,
- "pageSize": 0,
- "total": 0
}
}获取投递详情
Get delivery detail
| webhookId required | string |
| deliveryId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "webhookId": "string",
- "event": "request_created",
- "status": "pending",
- "url": "string",
- "requestBody": null,
- "responseStatus": 0,
- "responseBody": "string",
- "error": "string",
- "retryCount": 0,
- "deliveredAt": "string",
- "responseTime": 0,
- "createdAt": "string"
}
}重新投递
Redeliver
重新发送失败的 Webhook 事件。 Resend a failed webhook event.
| webhookId required | string |
| deliveryId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "webhookId": "string",
- "event": "request_created",
- "status": "pending",
- "url": "string",
- "requestBody": null,
- "responseStatus": 0,
- "responseBody": "string",
- "error": "string",
- "retryCount": 0,
- "deliveredAt": "string",
- "responseTime": 0,
- "createdAt": "string"
}
}暂停 Webhook
Pause webhook
暂停 Webhook,停止发送事件通知。 Pause webhook to stop sending event notifications.
| webhookId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}
}重新生成密钥
Regenerate secret
重新生成 Webhook 签名密钥。 Regenerate webhook signature secret.
| webhookId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "secret": "string"
}
}恢复 Webhook
Resume webhook
恢复已暂停的 Webhook。 Resume a paused webhook.
| webhookId required | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "name": "string",
- "description": "string",
- "url": "string",
- "events": [
- "request_created"
], - "filters": {
- "docTypes": [
- "string"
], - "docIds": [
- "string"
], - "userIds": [
- {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}
], - "conditions": [
- {
- "path": "string",
- "operator": "eq",
- "value": null
}
]
}, - "secret": "string",
- "status": "active",
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "timeout": 0,
- "maxRetries": 0,
- "retryInterval": 0,
- "createdAt": "string",
- "createdBy": {
- "id": "string",
- "displayName": "string",
- "email": "string",
- "avatarUrl": "string"
}, - "updatedAt": "string",
- "lastTriggeredAt": "string",
- "triggerCount": 0,
- "failureCount": 0
}
}获取 Webhook 统计
Get webhook statistics
获取 Webhook 的统计信息(成功率、失败率等)。 Get webhook statistics (success rate, failure rate, etc).
| webhookId required | string |
| startDate | string |
| endDate | string |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "totalTriggers": 0,
- "successCount": 0,
- "failureCount": 0,
- "successRate": 0.1,
- "avgResponseTime": 0.1,
- "lastSuccessAt": "string",
- "lastFailureAt": "string"
}
}测试 Webhook
Test webhook
发送测试事件到 Webhook URL,验证配置是否正确。 Send a test event to webhook URL to verify configuration.
| webhookId required | string |
| event required | string Enum: "request_created" "request_merged" "request_closed" "request_reopened" "approval_started" "approval_approved" "approval_rejected" "approval_canceled" "approval_node_completed" "comment_created" "comment_updated" "comment_deleted" "comment_resolved" "comment_mentioned" "metadata_updated" "metadata_field_added" "metadata_field_updated" "metadata_field_deleted" "view_created" "view_updated" "view_deleted" "view_default_changed" "data_row_created" "data_row_updated" "data_row_deleted" "data_bulk_operation" "revision_created" "revision_reverted" 测试事件类型 Test event type |
| payload | any 测试载荷 Test payload |
{- "event": "request_created",
- "payload": null
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "id": "string",
- "webhookId": "string",
- "event": "request_created",
- "status": "pending",
- "url": "string",
- "requestBody": null,
- "responseStatus": 0,
- "responseBody": "string",
- "error": "string",
- "retryCount": 0,
- "deliveredAt": "string",
- "responseTime": 0,
- "createdAt": "string"
}
}获取货币列表 Get currency list
获取系统支持的货币列表。 Get list of supported currencies.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/i18n/currencies' \
-H 'Authorization: Bearer TOKEN'
| includeInactive | boolean Default: false 是否包含不活跃的货币 Whether to include inactive currencies |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "currencies": [
- {
- "code": "string",
- "name": {
- "property1": "string",
- "property2": "string"
}, - "symbol": "string",
- "decimalPlaces": 0,
- "active": true
}
]
}
}检测文本语言 Detect text language
自动检测给定文本的语言。 Automatically detect language of given text.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/i18n/detect-language' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{"text": "这是一段测试文本"}'
| text required | string 待检测文本 Text to detect |
{- "text": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "detectedLanguage": "string",
- "confidence": 0.1,
- "alternatives": [
- {
- "language": "string",
- "confidence": 0.1
}
]
}
}格式化数据预览 Format data preview
根据指定的语言和格式设置预览格式化结果。 Preview formatting results based on specified language and format settings.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/i18n/format-preview' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"language": "zh",
"timezone": "Asia/Shanghai",
"dateFormat": "YYYY-MM-DD",
"timeFormat": "24h",
"currency": "CNY",
"samples": {
"date": "2024-12-06T10:30:00Z",
"number": 1234567.89,
"currency": 9999.99
}
}'
| language required | string 语言代码 Language code |
| timezone required | string 时区 Timezone |
| dateFormat required | string 日期格式 Date format |
| timeFormat required | string 时间格式 Time format |
| currency required | string 货币代码 Currency code |
required | object 示例数据 Sample data |
{- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "timeFormat": "string",
- "currency": "string",
- "samples": {
- "date": "string",
- "number": 0.1,
- "currency": 0.1
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "formatted": {
- "date": "string",
- "time": "string",
- "datetime": "string",
- "number": "string",
- "currency": "string"
}
}
}获取支持的语言列表 Get supported languages list
返回系统支持的所有语言配置列表。 Returns list of all supported language configurations.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/i18n/languages?enabledOnly=true' \
-H 'Authorization: Bearer TOKEN'
| enabledOnly | boolean Default: false 仅返回已启用的语言 Only return enabled languages |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": [
- {
- "code": "string",
- "name": {
- "property1": "string",
- "property2": "string"
}, - "nativeName": "string",
- "enabled": true,
- "isDefault": true,
- "direction": "ltr",
- "dateFormat": "string",
- "timeFormat": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string",
- "decimalPlaces": 0
}, - "currencyFormat": {
- "currencyCode": "string",
- "symbol": "string",
- "symbolPosition": "before",
- "decimalPlaces": 0
}, - "sortOrder": 0
}
]
}获取语言详细配置 Get language detailed configuration
返回指定语言的详细配置信息。 Returns detailed configuration for specified language.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/i18n/languages/zh' \
-H 'Authorization: Bearer TOKEN'
| languageCode required | string 语言代码 Language code |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "code": "string",
- "name": {
- "property1": "string",
- "property2": "string"
}, - "nativeName": "string",
- "enabled": true,
- "isDefault": true,
- "direction": "ltr",
- "dateFormat": "string",
- "timeFormat": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string",
- "decimalPlaces": 0
}, - "currencyFormat": {
- "currencyCode": "string",
- "symbol": "string",
- "symbolPosition": "before",
- "decimalPlaces": 0
}, - "sortOrder": 0
}
}获取翻译术语表 Get translation glossary
获取组织的翻译术语表。 Get organization's translation glossary.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/glossary?sourceLanguage=zh&targetLanguage=en' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| sourceLanguage | string 源语言 Source language |
| targetLanguage | string 目标语言 Target language |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "entries": [
- {
- "id": "string",
- "term": "string",
- "translation": "string",
- "context": "string",
- "category": "string",
- "createdAt": "string"
}
]
}
}添加术语到翻译术语表 Add term to translation glossary
添加术语到组织的翻译术语表。需要 owner 或 admin 权限。 Add term to organization's translation glossary. Requires owner or admin permission.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/glossary' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"sourceLanguage": "zh",
"targetLanguage": "en",
"entries": [{
"term": "订货单",
"translation": "Purchase Order",
"context": "business_document",
"category": "general"
}]
}'
| organizationId required | string 组织ID Organization ID |
| sourceLanguage required | string 源语言 Source language |
| targetLanguage required | string 目标语言 Target language |
required | Array of objects 术语条目列表 Glossary entries |
{- "sourceLanguage": "string",
- "targetLanguage": "string",
- "entries": [
- {
- "term": "string",
- "translation": "string",
- "context": "string",
- "category": "string"
}
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "added": 0,
- "entries": [
- {
- "id": "string",
- "term": "string",
- "translation": "string",
- "context": "string",
- "category": "string",
- "createdAt": "string"
}
]
}
}获取时区列表 Get timezone list
获取系统支持的时区列表。 Get list of supported timezones.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/i18n/timezones?region=Asia' \
-H 'Authorization: Bearer TOKEN'
| region | string 按地区过滤 Filter by region |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "timezones": [
- {
- "id": "string",
- "name": "string",
- "offset": "string",
- "region": "string",
- "displayName": {
- "property1": "string",
- "property2": "string"
}
}
]
}
}翻译文本内容 Translate text content
将文本从源语言翻译到目标语言。 Translate text from source language to target languages.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/i18n/translate' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"sourceLanguage": "zh",
"targetLanguages": ["en", "ja"],
"texts": ["产品名称", "这是产品描述"],
"context": "product_catalog"
}'
| sourceLanguage required | string 源语言 Source language |
| targetLanguages required | Array of strings 目标语言列表 Target languages |
| texts required | Array of strings 待翻译文本列表 Texts to translate |
| context | string 上下文 Context |
{- "sourceLanguage": "string",
- "targetLanguages": [
- "string"
], - "texts": [
- "string"
], - "context": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "translations": [
- {
- "sourceText": "string",
- "translations": {
- "property1": "string",
- "property2": "string"
}, - "confidence": {
- "property1": 0.1,
- "property2": 0.1
}
}
]
}
}获取翻译完整度统计 Get translation coverage statistics
获取各语言的翻译完整度统计信息。 Get translation coverage statistics for each language.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/i18n/translation-coverage?namespace=common' \
-H 'Authorization: Bearer TOKEN'
| ns | string 命名空间过滤 Namespace filter |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "languages": [
- {
- "language": "string",
- "totalKeys": 0,
- "translatedKeys": 0,
- "missingKeys": 0,
- "completeness": 0.1,
- "lastUpdated": "string"
}
]
}
}获取翻译建议 Get translation suggestions
获取文本的翻译建议。 Get translation suggestions for text.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/i18n/translation-suggestions' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"text": "产品",
"sourceLanguage": "zh",
"targetLanguage": "en",
"context": "field_label",
"maxSuggestions": 5
}'
| text required | string 待翻译文本 Text to translate |
| sourceLanguage required | string 源语言 Source language |
| targetLanguage required | string 目标语言 Target language |
| context | string 上下文 Context |
| maxSuggestions | integer <int32> 最大建议数 Maximum suggestions |
{- "text": "string",
- "sourceLanguage": "string",
- "targetLanguage": "string",
- "context": "string",
- "maxSuggestions": 0
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "suggestions": [
- {
- "translation": "string",
- "confidence": 0.1,
- "source": "machine"
}
]
}
}获取翻译资源 Get translation resources
获取指定语言的翻译资源。 Get translation resources for specified language.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/i18n/translations?language=zh&namespace=common' \
-H 'Authorization: Bearer TOKEN'
| language required | string 语言代码(必填) Language code (required) |
| ns | string 命名空间过滤 Namespace filter |
| keys | Array of strings 指定键列表 Specified keys |
| category | string (I18n.ResourceCategory) Enum: "ui" "field_label" "validation_message" "notification_template" "email_template" "system_message" 资源分类 Resource category |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "language": "string",
- "translations": {
- "property1": "string",
- "property2": "string"
}, - "fallbackLanguage": "string",
- "completeness": 0.1
}
}批量获取多语言翻译 Batch get multi-language translations
一次性获取多个语言的翻译资源。 Get translation resources for multiple languages at once.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/i18n/translations/batch' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"languages": ["zh", "en", "ja"],
"namespace": "common",
"keys": ["button.save", "button.cancel"]
}'
| languages required | Array of strings 语言列表 Languages |
| ns | string 命名空间 Namespace |
| keys | Array of strings 键列表 Keys |
{- "languages": [
- "string"
], - "ns": "string",
- "keys": [
- "string"
]
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "translations": {
- "property1": {
- "property1": "string",
- "property2": "string"
}, - "property2": {
- "property1": "string",
- "property2": "string"
}
}
}
}获取组织国际化配置 Get organization i18n configuration
返回组织的国际化配置信息。 Returns organization's i18n configuration.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/config' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "defaultLanguage": "string",
- "supportedLanguages": [
- "string"
], - "enforceLanguage": true,
- "autoDetectLanguage": true,
- "fallbackLanguage": "string",
- "defaultTimezone": "string",
- "defaultCurrency": "string",
- "dateFormat": "string",
- "timeFormat": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string",
- "decimalPlaces": 0
}
}
}更新组织国际化配置 Update organization i18n configuration
更新组织的国际化配置。需要 owner 或 admin 权限。 Update organization's i18n configuration. Requires owner or admin permission.
示例(cURL):
curl -X PUT 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/config' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"defaultLanguage": "zh",
"supportedLanguages": ["zh", "en", "ja"],
"enforceLanguage": false,
"autoDetectLanguage": true,
"fallbackLanguage": "en",
"defaultTimezone": "Asia/Shanghai",
"defaultCurrency": "CNY",
"dateFormat": "YYYY-MM-DD",
"timeFormat": "24h"
}'
| organizationId required | string 组织ID Organization ID |
| defaultLanguage required | string 默认语言 Default language |
| supportedLanguages required | Array of strings 支持的语言列表 Supported languages |
| enforceLanguage required | boolean 强制使用指定语言 Enforce specific language |
| autoDetectLanguage required | boolean 自动检测语言 Auto detect language |
| fallbackLanguage required | string 备用语言 Fallback language |
| defaultTimezone required | string 默认时区 Default timezone |
| defaultCurrency required | string 默认货币 Default currency |
| dateFormat required | string 日期格式 Date format |
| timeFormat required | string 时间格式 Time format |
required | object 数字格式 Number format |
{- "defaultLanguage": "string",
- "supportedLanguages": [
- "string"
], - "enforceLanguage": true,
- "autoDetectLanguage": true,
- "fallbackLanguage": "string",
- "defaultTimezone": "string",
- "defaultCurrency": "string",
- "dateFormat": "string",
- "timeFormat": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string",
- "decimalPlaces": 0
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "defaultLanguage": "string",
- "supportedLanguages": [
- "string"
], - "enforceLanguage": true,
- "autoDetectLanguage": true,
- "fallbackLanguage": "string",
- "defaultTimezone": "string",
- "defaultCurrency": "string",
- "dateFormat": "string",
- "timeFormat": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string",
- "decimalPlaces": 0
}
}
}获取组织自定义翻译 Get organization custom translations
获取组织自定义的翻译资源。 Get organization's custom translation resources.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/custom-translations?language=zh&namespace=custom' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| language | string 语言代码 Language code |
| ns | string 命名空间 Namespace |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "customTranslations": {
- "property1": "string",
- "property2": "string"
}, - "inheritedTranslations": {
- "property1": "string",
- "property2": "string"
}
}
}添加/更新组织自定义翻译 Add/update organization custom translations
添加或更新组织的自定义翻译。需要 owner 或 admin 权限。 Add or update organization's custom translations. Requires owner or admin permission.
示例(cURL):
curl -X PUT 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/custom-translations' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"language": "zh",
"namespace": "custom",
"translations": {
"field.custom_status": "自定义状态",
"label.department": "部门名称"
}
}'
| organizationId required | string 组织ID Organization ID |
| language required | string 语言代码 Language code |
| ns required | string 命名空间 Namespace |
required | object 翻译内容 Translations |
{- "language": "string",
- "ns": "string",
- "translations": {
- "property1": "string",
- "property2": "string"
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "added": 0,
- "updated": 0,
- "translations": {
- "property1": "string",
- "property2": "string"
}
}
}删除组织自定义翻译 Delete organization custom translations
删除组织的自定义翻译。需要 owner 或 admin 权限。 Delete organization's custom translations. Requires owner or admin permission.
示例(cURL):
curl -X DELETE 'https://open.nexusbook.app/api/v1/organizations/org-123/i18n/custom-translations?language=zh&keys=field.custom_status,label.department' \
-H 'Authorization: Bearer TOKEN'
| organizationId required | string 组织ID Organization ID |
| language required | string 语言代码 Language code |
| keys required | Array of strings 要删除的键列表 Keys to delete |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "deleted": 0
}
}获取当前用户偏好设置 Get current user preferences
返回当前用户的完整偏好设置或指定部分。 Returns complete preferences or specified section for current user.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/users/me/preferences?section=regional' \
-H 'Authorization: Bearer TOKEN'
| section | string 获取特定部分 Get specific section (general/appearance/notifications/regional/accessibility/privacy) |
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "userId": "string",
- "general": {
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "defaultView": "string",
- "startPage": "string",
- "itemsPerPage": 0,
- "enableKeyboardShortcuts": true,
- "enableAnimations": true
}, - "appearance": {
- "theme": "light",
- "accentColor": "string",
- "fontFamily": "string",
- "fontSize": "small",
- "density": "compact",
- "sidebarCollapsed": true
}, - "notifications": { },
- "regional": {
- "language": "string",
- "contentLanguages": [
- "string"
], - "timezone": "string",
- "dateFormat": "string",
- "timeFormat": "12h",
- "firstDayOfWeek": "sunday",
- "currency": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string"
}
}, - "accessibility": {
- "highContrast": true,
- "reducedMotion": true,
- "screenReader": true,
- "keyboardNavigation": true,
- "focusIndicator": true,
- "textToSpeech": true
}, - "privacy": {
- "showPresenceStatus": true,
- "allowAnalytics": true,
- "allowMarketing": true,
- "showProfileToOthers": true,
- "shareActivityStatus": true
}, - "updatedAt": "string"
}
}更新用户偏好设置 Update user preferences
更新当前用户的偏好设置(部分更新)。 Update current user's preferences (partial update).
示例(cURL):
curl -X PATCH 'https://open.nexusbook.app/api/v1/users/me/preferences' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"regional": {
"language": "zh",
"timezone": "Asia/Shanghai",
"dateFormat": "YYYY-MM-DD",
"timeFormat": "24h",
"firstDayOfWeek": "monday",
"currency": "CNY"
}
}'
object 通用偏好 General preferences | |
object 外观偏好 Appearance preferences | |
object 地区偏好 Regional preferences | |
object 辅助功能偏好 Accessibility preferences | |
object 隐私偏好 Privacy preferences |
{- "general": {
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "defaultView": "string",
- "startPage": "string",
- "itemsPerPage": 0,
- "enableKeyboardShortcuts": true,
- "enableAnimations": true
}, - "appearance": {
- "theme": "light",
- "accentColor": "string",
- "fontFamily": "string",
- "fontSize": "small",
- "density": "compact",
- "sidebarCollapsed": true
}, - "regional": {
- "language": "string",
- "contentLanguages": [
- "string"
], - "timezone": "string",
- "dateFormat": "string",
- "timeFormat": "12h",
- "firstDayOfWeek": "sunday",
- "currency": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string"
}
}, - "accessibility": {
- "highContrast": true,
- "reducedMotion": true,
- "screenReader": true,
- "keyboardNavigation": true,
- "focusIndicator": true,
- "textToSpeech": true
}, - "privacy": {
- "showPresenceStatus": true,
- "allowAnalytics": true,
- "allowMarketing": true,
- "showProfileToOthers": true,
- "shareActivityStatus": true
}
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "userId": "string",
- "general": {
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "defaultView": "string",
- "startPage": "string",
- "itemsPerPage": 0,
- "enableKeyboardShortcuts": true,
- "enableAnimations": true
}, - "appearance": {
- "theme": "light",
- "accentColor": "string",
- "fontFamily": "string",
- "fontSize": "small",
- "density": "compact",
- "sidebarCollapsed": true
}, - "notifications": { },
- "regional": {
- "language": "string",
- "contentLanguages": [
- "string"
], - "timezone": "string",
- "dateFormat": "string",
- "timeFormat": "12h",
- "firstDayOfWeek": "sunday",
- "currency": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string"
}
}, - "accessibility": {
- "highContrast": true,
- "reducedMotion": true,
- "screenReader": true,
- "keyboardNavigation": true,
- "focusIndicator": true,
- "textToSpeech": true
}, - "privacy": {
- "showPresenceStatus": true,
- "allowAnalytics": true,
- "allowMarketing": true,
- "showProfileToOthers": true,
- "shareActivityStatus": true
}, - "updatedAt": "string"
}
}获取用户语言偏好 Get user language preferences
获取当前用户的语言相关偏好设置。 Get language-related preferences for current user.
示例(cURL):
curl -X GET 'https://open.nexusbook.app/api/v1/users/me/preferences/language' \
-H 'Authorization: Bearer TOKEN'
{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "primaryLanguage": "string",
- "contentLanguages": [
- "string"
], - "autoDetect": true,
- "fallbackLanguage": "string"
}
}更新用户语言偏好 Update user language preferences
更新当前用户的语言相关偏好设置。 Update language-related preferences for current user.
示例(cURL):
curl -X PUT 'https://open.nexusbook.app/api/v1/users/me/preferences/language' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"primaryLanguage": "zh",
"contentLanguages": ["zh", "en", "ja"],
"autoDetect": true,
"fallbackLanguage": "en"
}'
| primaryLanguage required | string 主要语言 Primary language |
| contentLanguages required | Array of strings 内容语言列表 Content languages |
| autoDetect required | boolean 自动检测语言 Auto detect language |
| fallbackLanguage required | string 备用语言 Fallback language |
{- "primaryLanguage": "string",
- "contentLanguages": [
- "string"
], - "autoDetect": true,
- "fallbackLanguage": "string"
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "primaryLanguage": "string",
- "contentLanguages": [
- "string"
], - "autoDetect": true,
- "fallbackLanguage": "string"
}
}重置用户偏好为默认值 Reset user preferences to defaults
将指定部分或全部偏好设置重置为默认值。 Reset specified sections or all preferences to defaults.
示例(cURL):
curl -X POST 'https://open.nexusbook.app/api/v1/users/me/preferences/reset' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"sections": ["appearance", "notifications"],
"resetAll": false
}'
| sections | Array of strings 要重置的部分列表 Sections to reset |
| resetAll | boolean 重置全部 Reset all |
{- "sections": [
- "string"
], - "resetAll": true
}{- "success": true,
- "code": "BAD_USER_NAME",
- "message": {
- "property1": "string",
- "property2": "string"
}, - "payload": {
- "userId": "string",
- "general": {
- "defaultOrganizationId": "string",
- "defaultWorkspaceId": "string",
- "defaultView": "string",
- "startPage": "string",
- "itemsPerPage": 0,
- "enableKeyboardShortcuts": true,
- "enableAnimations": true
}, - "appearance": {
- "theme": "light",
- "accentColor": "string",
- "fontFamily": "string",
- "fontSize": "small",
- "density": "compact",
- "sidebarCollapsed": true
}, - "notifications": { },
- "regional": {
- "language": "string",
- "contentLanguages": [
- "string"
], - "timezone": "string",
- "dateFormat": "string",
- "timeFormat": "12h",
- "firstDayOfWeek": "sunday",
- "currency": "string",
- "numberFormat": {
- "decimalSeparator": "string",
- "thousandSeparator": "string"
}
}, - "accessibility": {
- "highContrast": true,
- "reducedMotion": true,
- "screenReader": true,
- "keyboardNavigation": true,
- "focusIndicator": true,
- "textToSpeech": true
}, - "privacy": {
- "showPresenceStatus": true,
- "allowAnalytics": true,
- "allowMarketing": true,
- "showProfileToOthers": true,
- "shareActivityStatus": true
}, - "updatedAt": "string"
}
}