
语言 🇨🇳 简体中文
入门
文档
聚合
审计日志
从评论屏蔽
检查被屏蔽的评论
评论
域配置
邮件模板
事件日志
动态帖子
标记评论
话题标签
版主
通知计数
通知
页面
待处理的 webhook 事件
问卷配置
问卷结果
问卷结果汇总
单点登录用户
订阅
租户每日使用情况
租户套餐
租户用户
租户
上传图片
用户徽章进度
用户徽章
用户通知
用户在线状态
用户搜索
用户
投票
FastComments Rust SDK
这是 FastComments 的官方 Rust SDK。
FastComments API 的官方 Rust SDK
仓库
库内容 
The FastComments Rust SDK 由若干模块组成:
Client Module - 为 FastComments REST API 自动生成的 API 客户端
- 提供所有 API 模型的完整类型定义
- 包含已认证的(
DefaultApi)和公共的(PublicApi)端点 - 使用 tokio 完全支持 async/await
- 详见 client/README.md 获取详细的 API 文档
SSO Module - 服务器端单点登录实用工具
- 用于用户认证的安全令牌生成
- 支持简单和安全两种 SSO 模式
- 基于 HMAC-SHA256 的令牌签名
Core Types - 共享类型定义和实用工具
- 评论模型和元数据结构
- 用户和租户配置
- 常用操作的辅助函数
快速开始 
使用公共 API
use fastcomments_sdk::client::apis::configuration::Configuration;
use fastcomments_sdk::client::apis::public_api;
#[tokio::main]
async fn main() {
// 创建 API 配置
let config = Configuration::new();
// 获取页面的评论
let result = public_api::get_comments_public(
&config,
public_api::GetCommentsPublicParams {
tenant_id: "your-tenant-id".to_string(),
urlid: Some("page-url-id".to_string()),
url: None,
count_only: None,
skip: None,
limit: None,
sort_dir: None,
page: None,
sso_hash: None,
simple_sso_hash: None,
has_no_comment: None,
has_comment: None,
comment_id_filter: None,
child_ids: None,
start_date_time: None,
starts_with: None,
},
)
.await;
match result {
Ok(response) => {
println!("Found {} comments", response.comments.len());
for comment in response.comments {
println!("Comment: {:?}", comment);
}
}
Err(e) => eprintln!("Error fetching comments: {:?}", e),
}
}
使用已认证的 API
use fastcomments_sdk::client::apis::configuration::{ApiKey, Configuration};
use fastcomments_sdk::client::apis::default_api;
#[tokio::main]
async fn main() {
// 使用 API 密钥创建配置
let mut config = Configuration::new();
config.api_key = Some(ApiKey {
prefix: None,
key: "your-api-key".to_string(),
});
// 使用已认证的 API 获取评论
let result = default_api::get_comments(
&config,
default_api::GetCommentsParams {
tenant_id: "your-tenant-id".to_string(),
skip: None,
limit: None,
sort_dir: None,
urlid: Some("page-url-id".to_string()),
url: None,
is_spam: None,
user_id: None,
all_comments: None,
for_moderation: None,
parent_id: None,
is_flagged: None,
is_flagged_tag: None,
is_by_verified: None,
is_pinned: None,
asc: None,
include_imported: None,
origin: None,
tags: None,
},
)
.await;
match result {
Ok(response) => {
println!("Total comments: {}", response.count);
for comment in response.comments {
println!("Comment ID: {}, Text: {}", comment.id, comment.comment);
}
}
Err(e) => eprintln!("Error: {:?}", e),
}
}
使用 SSO 进行身份验证
use fastcomments_sdk::sso::{
fastcomments_sso::FastCommentsSSO,
secure_sso_user_data::SecureSSOUserData,
};
fn main() {
let api_key = "your-api-key".to_string();
// 创建安全的 SSO 用户数据(仅限服务器端!)
let user_data = SecureSSOUserData::new(
"user-123".to_string(), // 用户 ID
"user@example.com".to_string(), // 电子邮件
"John Doe".to_string(), // 用户名
"https://example.com/avatar.jpg".to_string(), // 头像 URL
);
// 生成 SSO 令牌
let sso = FastCommentsSSO::new_secure(api_key, &user_data).unwrap();
let token = sso.create_token().unwrap();
println!("SSO Token: {}", token);
// 将此令牌传递给前端以进行身份验证
}
常见问题 
401 未授权错误
如果在使用需要身份验证的 API 时遇到 401 错误:
- 检查你的 API key:确保你正在使用来自 FastComments dashboard 的正确 API key
- 验证 tenant ID:确保 tenant ID 与您的帐户匹配
- API key 格式:API key 应在 Configuration 中传递:
let mut config = Configuration::new();
config.api_key = Some(ApiKey {
prefix: None,
key: "YOUR_API_KEY".to_string(),
});
SSO 令牌问题
如果 SSO 令牌 无法正常工作:
- 在生产环境中使用安全模式:始终在生产环境使用
FastCommentsSSO::new_secure()并搭配您的 API key - 仅限服务器端:在服务器上生成 SSO 令牌,切勿将您的 API key 暴露给客户端
- 检查用户数据:确保所有必需字段 (id, email, username) 已提供
异步运行时错误
该 SDK 使用 tokio 进行异步操作。请确保:
将 tokio 添加到您的依赖项:
[dependencies] tokio = { version = "1", features = ["full"] }使用 tokio 运行时:
#[tokio::main] async fn main() { // 在此处放置您的异步代码 }
注意事项 
广播 ID
你会看到在某些 API 调用中需要传入 broadcastId。当你接收到事件时,会返回这个 ID,因此如果你计划在客户端乐观地应用更改,就可以据此忽略该事件
(你很可能会想这样做,因为它能提供最佳体验)。在此处传入 UUID。该 ID 应足够唯一,以免在同一浏览器会话中出现两次。
聚合 
通过对文档进行分组(如果提供了 groupBy)并应用多个操作来聚合文档。支持不同的操作(例如 sum、countDistinct、avg 等)。
参数
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| aggregation_request | models::AggregationRequest | 是 | |
| parent_tenant_id | String | 否 | |
| include_stats | bool | 否 |
响应
获取审计日志 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| limit | f64 | 否 | |
| skip | f64 | 否 | |
| order | models::SortDir | 否 | |
| after | f64 | 否 | |
| before | f64 | 否 |
响应
在公开评论中屏蔽 
参数
| Name | Type | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| public_block_from_comment_params | models::PublicBlockFromCommentParams | 是 | |
| sso | String | 否 |
响应
返回: BlockFromCommentPublic200Response
取消公开评论屏蔽 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| public_block_from_comment_params | models::PublicBlockFromCommentParams | 是 | |
| sso | String | 否 |
响应
返回: UnBlockCommentPublic200Response
从评论中屏蔽用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| block_from_comment_params | models::BlockFromCommentParams | 是 | |
| user_id | String | 否 | |
| anon_user_id | String | 否 |
响应
返回: BlockFromCommentPublic200Response
创建公开评论 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| broadcast_id | String | 是 | |
| comment_data | models::CommentData | 是 | |
| session_id | String | 否 | |
| sso | String | 否 |
响应
返回: CreateCommentPublic200Response
删除公开评论 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| broadcast_id | String | 是 | |
| edit_key | String | 否 | |
| sso | String | 否 |
响应
删除评论投票 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| vote_id | String | 是 | |
| url_id | String | 是 | |
| broadcast_id | String | 是 | |
| edit_key | String | 否 | |
| sso | String | 否 |
响应
返回: DeleteCommentVote200Response
获取评论投票用户名 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| dir | i32 | 是 | |
| sso | String | 否 |
响应
返回:GetCommentVoteUserNames200Response
获取评论列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| page | i32 | 否 | |
| limit | i32 | 否 | |
| skip | i32 | 否 | |
| as_tree | bool | 否 | |
| skip_children | i32 | 否 | |
| limit_children | i32 | 否 | |
| max_tree_depth | i32 | 否 | |
| url_id | String | 否 | |
| user_id | String | 否 | |
| anon_user_id | String | 否 | |
| context_user_id | String | 否 | |
| hash_tag | String | 否 | |
| parent_id | String | 否 | |
| direction | models::SortDirections | 否 |
响应
获取公开评论 
req tenantId urlId
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| page | i32 | 否 | |
| direction | models::SortDirections | 否 | |
| sso | String | 否 | |
| skip | i32 | 否 | |
| skip_children | i32 | 否 | |
| limit | i32 | 否 | |
| limit_children | i32 | 否 | |
| count_children | bool | 否 | |
| fetch_page_for_comment_id | String | 否 | |
| include_config | bool | 否 | |
| count_all | bool | 否 | |
| includei10n | bool | 否 | |
| locale | String | 否 | |
| modules | String | 否 | |
| is_crawler | bool | 否 | |
| include_notification_count | bool | 否 | |
| as_tree | bool | 否 | |
| max_tree_depth | i32 | 否 | |
| use_full_translation_ids | bool | 否 | |
| parent_id | String | 否 | |
| search_text | String | 否 | |
| hash_tags | Vec |
否 | |
| user_id | String | 否 | |
| custom_config_str | String | 否 | |
| after_comment_id | String | 否 | |
| before_comment_id | String | 否 |
响应
返回: GetCommentsPublic200Response
保存评论 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_comment_params | models::CreateCommentParams | 是 | |
| is_live | bool | 否 | |
| do_spam_check | bool | 否 | |
| send_emails | bool | 否 | |
| populate_notifications | bool | 否 |
响应
批量保存评论 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_comment_params | Vecmodels::CreateCommentParams | 是 | |
| is_live | bool | 否 | |
| do_spam_check | bool | 否 | |
| send_emails | bool | 否 | |
| populate_notifications | bool | 否 |
响应
返回: Vec<models::SaveComment200Response>
设置评论文本 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| broadcast_id | String | 是 | |
| comment_text_update_request | models::CommentTextUpdateRequest | 是 | |
| edit_key | String | 否 | |
| sso | String | 否 |
响应
取消从评论中屏蔽用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| un_block_from_comment_params | models::UnBlockFromCommentParams | 是 | |
| user_id | String | 否 | |
| anon_user_id | String | 否 |
响应
返回: UnBlockCommentPublic200Response
解锁评论 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| broadcast_id | String | 是 | |
| sso | String | 否 |
响应
更新评论 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| body | models::PickApiCommentPeriodUpdatableCommentFields | 是 | |
| context_user_id | String | 否 | |
| do_spam_check | bool | 否 | |
| is_live | bool | 否 |
响应
返回: FlagCommentPublic200Response
对评论投票 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| url_id | String | 是 | |
| broadcast_id | String | 是 | |
| vote_body_params | models::VoteBodyParams | 是 | |
| session_id | String | 否 | |
| sso | String | 否 |
响应
添加域配置 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| add_domain_config_params | models::AddDomainConfigParams | 是 |
响应
返回: AddDomainConfig200Response
部分更新域配置 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| domain_to_update | String | 是 | |
| patch_domain_config_params | models::PatchDomainConfigParams | 是 |
响应
替换域配置 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| domain_to_update | String | 是 | |
| update_domain_config_params | models::UpdateDomainConfigParams | 是 |
响应
返回: GetDomainConfig200Response
创建邮件模板 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_email_template_body | models::CreateEmailTemplateBody | 是 |
响应
返回: CreateEmailTemplate200Response
示例

删除邮件模板 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: FlagCommentPublic200Response
示例

删除邮件模板渲染错误 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| error_id | String | 是 |
响应
返回: FlagCommentPublic200Response
示例

获取邮件模板 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: GetEmailTemplate200Response
示例

获取邮件模板定义 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 |
响应
返回: GetEmailTemplateDefinitions200Response
示例

获取邮件模板渲染错误 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| skip | f64 | 否 |
响应
返回:GetEmailTemplateRenderErrors200Response
示例

获取邮件模板列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| skip | f64 | 否 |
响应
返回:GetEmailTemplates200Response
示例

渲染邮件模板 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| render_email_template_body | models::RenderEmailTemplateBody | 是 | |
| locale | String | 否 |
响应
返回:RenderEmailTemplate200Response
示例

更新邮件模板 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_email_template_body | models::UpdateEmailTemplateBody | 是 |
响应
返回: FlagCommentPublic200Response
示例

获取事件日志 
req tenantId urlId userIdWS
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| user_id_ws | String | 是 | |
| start_time | i64 | 是 | |
| end_time | i64 | 是 |
响应
获取全局事件日志 
req tenantId urlId userIdWS
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| user_id_ws | String | 是 | |
| start_time | i64 | 是 | |
| end_time | i64 | 是 |
响应
创建动态帖子 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_feed_post_params | models::CreateFeedPostParams | 是 | |
| broadcast_id | String | 否 | |
| is_live | bool | 否 | |
| do_spam_check | bool | 否 | |
| skip_dup_check | bool | 否 |
响应
创建公开动态帖子 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_feed_post_params | models::CreateFeedPostParams | 是 | |
| broadcast_id | String | 否 | |
| sso | String | 否 |
响应
返回: CreateFeedPostPublic200Response
删除公开动态帖子 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| post_id | String | 是 | |
| broadcast_id | String | 否 | |
| sso | String | 否 |
响应
返回: DeleteFeedPostPublic200Response
获取动态帖子 
req tenantId afterId
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| after_id | String | 否 | |
| limit | i32 | 否 | |
| tags | Vec |
否 |
响应
获取公开动态帖子 
req tenantId afterId
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| after_id | String | 否 | |
| limit | i32 | 否 | |
| tags | Vec |
否 | |
| sso | String | 否 | |
| is_crawler | bool | 否 | |
| include_user_info | bool | 否 |
响应
对公开动态帖子进行反应 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| post_id | String | 是 | |
| react_body_params | models::ReactBodyParams | 是 | |
| is_undo | bool | 否 | |
| broadcast_id | String | 否 | |
| sso | String | 否 |
响应
返回: ReactFeedPostPublic200Response
更新动态帖子 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| feed_post | models::FeedPost | 是 |
响应
返回: FlagCommentPublic200Response
更新公开动态帖子 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| post_id | String | 是 | |
| update_feed_post_params | models::UpdateFeedPostParams | 是 | |
| broadcast_id | String | 否 | |
| sso | String | 否 |
响应
返回: CreateFeedPostPublic200Response
标记公开评论 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| is_flagged | bool | 是 | |
| sso | String | 否 |
响应
返回: FlagCommentPublic200Response
添加话题标签 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 否 | |
| create_hash_tag_body | models::CreateHashTagBody | 否 |
响应
示例

批量添加话题标签 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 否 | |
| bulk_create_hash_tags_body | models::BulkCreateHashTagsBody | 否 |
响应
示例

删除话题标签 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tag | String | 是 | |
| tenant_id | String | 否 | |
| delete_hash_tag_request | models::DeleteHashTagRequest | 否 |
响应
返回: FlagCommentPublic200Response
示例

获取话题标签 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| page | f64 | 否 |
响应
示例

部分更新话题标签 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tag | String | 是 | |
| tenant_id | String | 否 | |
| update_hash_tag_body | models::UpdateHashTagBody | 否 |
响应
示例

创建版主 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_moderator_body | models::CreateModeratorBody | 是 |
响应
示例

删除版主 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| send_email | String | 否 |
响应
返回: FlagCommentPublic200Response
示例

获取版主 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | Yes | |
| id | String | Yes |
响应
示例

获取版主列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| skip | f64 | 否 |
响应
示例

发送邀请 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| from_name | String | 是 |
响应
返回: FlagCommentPublic200Response
示例

更新版主 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_moderator_body | models::UpdateModeratorBody | 是 |
响应
返回: FlagCommentPublic200Response
示例

删除通知计数 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回:FlagCommentPublic200Response
示例

获取缓存的通知计数 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: GetCachedNotificationCount200Response
示例

获取通知计数 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| user_id | String | 否 | |
| url_id | String | 否 | |
| from_comment_id | String | 否 | |
| viewed | bool | 否 |
响应
返回: GetNotificationCount200Response
示例

获取通知 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| user_id | String | 否 | |
| url_id | String | 否 | |
| from_comment_id | String | 否 | |
| viewed | bool | 否 | |
| skip | f64 | 否 |
响应
返回: GetNotifications200Response
示例

更新通知 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_notification_body | models::UpdateNotificationBody | 是 | |
| user_id | String | 否 |
响应
返回: FlagCommentPublic200Response
示例

部分更新页面 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_api_page_data | models::UpdateApiPageData | 是 |
响应
删除待处理的 webhook 事件 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回:FlagCommentPublic200Response
示例

获取待处理 webhook 事件计数 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 否 | |
| external_id | String | 否 | |
| event_type | String | 否 | |
| domain | String | 否 | |
| attempt_count_gt | f64 | 否 |
返回
返回: GetPendingWebhookEventCount200Response
示例

获取待处理的 webhook 事件 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 否 | |
| external_id | String | 否 | |
| event_type | String | 否 | |
| domain | String | 否 | |
| attempt_count_gt | f64 | 否 | |
| skip | f64 | 否 |
响应
返回: GetPendingWebhookEvents200Response
示例

创建问卷配置 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_question_config_body | models::CreateQuestionConfigBody | 是 |
响应
返回: CreateQuestionConfig200Response
示例

删除问卷配置 
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: FlagCommentPublic200Response
示例

获取问卷配置 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: GetQuestionConfig200Response
示例

获取问卷配置列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| skip | f64 | 否 |
响应
返回: GetQuestionConfigs200Response
示例

更新问卷配置 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_question_config_body | models::UpdateQuestionConfigBody | 是 |
响应
返回: FlagCommentPublic200Response
示例

创建问卷结果 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_question_result_body | models::CreateQuestionResultBody | 是 |
响应
返回: CreateQuestionResult200Response
示例

删除问卷结果 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回:FlagCommentPublic200Response
示例

获取问卷结果 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: GetQuestionResult200Response
示例

获取问卷结果列表 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 否 | |
| user_id | String | 否 | |
| start_date | String | 否 | |
| question_id | String | 否 | |
| question_ids | String | 否 | |
| skip | f64 | 否 |
响应
返回: GetQuestionResults200Response
示例

更新问卷结果 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_question_result_body | models::UpdateQuestionResultBody | 是 |
响应
返回: FlagCommentPublic200Response
示例

聚合问卷结果 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| question_id | String | 否 | |
| question_ids | Vec |
否 | |
| url_id | String | 否 | |
| time_bucket | models::AggregateTimeBucket | 否 | |
| start_date | String | 否 | |
| force_recalculate | bool | 否 |
响应
返回: AggregateQuestionResults200Response
批量聚合问卷结果 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| bulk_aggregate_question_results_request | models::BulkAggregateQuestionResultsRequest | 是 | |
| force_recalculate | bool | 否 |
响应
返回: BulkAggregateQuestionResults200Response
将评论与问卷结果合并 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| question_id | String | 否 | |
| question_ids | Vec |
否 | |
| url_id | String | 否 | |
| start_date | String | 否 | |
| force_recalculate | bool | 否 | |
| min_value | f64 | 否 | |
| max_value | f64 | 否 | |
| limit | f64 | 否 |
响应
返回:CombineCommentsWithQuestionResults200Response
添加单点登录用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_apisso_user_data | models::CreateApissoUserData | 是 |
响应
删除单点登录用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| delete_comments | bool | 否 | |
| comment_delete_mode | String | 否 |
响应
部分更新单点登录用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_apisso_user_data | models::UpdateApissoUserData | 是 | |
| update_comments | bool | 否 |
响应
替换单点登录用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_apisso_user_data | models::UpdateApissoUserData | 是 | |
| update_comments | bool | 否 |
响应
创建订阅 
参数
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_api_user_subscription_data | models::CreateApiUserSubscriptionData | 是 |
响应
获取租户每日使用情况 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| year_number | f64 | 否 | |
| month_number | f64 | 否 | |
| day_number | f64 | 否 | |
| skip | f64 | 否 |
响应
返回: GetTenantDailyUsages200Response
示例

创建租户套餐 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_tenant_package_body | models::CreateTenantPackageBody | 是 |
响应
返回: CreateTenantPackage200Response
示例

删除租户套餐 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回:FlagCommentPublic200Response
示例

获取租户套餐 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
返回: GetTenantPackage200Response
示例

获取租户套餐列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| skip | f64 | 否 |
响应
返回: GetTenantPackages200Response
示例

替换租户套餐 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| replace_tenant_package_body | models::ReplaceTenantPackageBody | 是 |
响应
返回: FlagCommentPublic200Response
示例

更新租户套餐 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_tenant_package_body | models::UpdateTenantPackageBody | 是 |
响应
返回: FlagCommentPublic200Response
示例

创建租户用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_tenant_user_body | models::CreateTenantUserBody | 是 |
响应
返回:CreateTenantUser200Response
示例

删除租户用户 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| delete_comments | String | 否 | |
| comment_delete_mode | String | 否 |
响应
返回: FlagCommentPublic200Response
示例

获取租户用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
示例

获取租户用户列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| skip | f64 | 否 |
响应
示例

替换租户用户 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| replace_tenant_user_body | models::ReplaceTenantUserBody | 是 | |
| update_comments | String | 否 |
响应
返回: FlagCommentPublic200Response
示例

发送登录链接 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| redirect_url | String | 否 |
响应
返回: FlagCommentPublic200Response
示例

更新租户用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_tenant_user_body | models::UpdateTenantUserBody | 是 | |
| update_comments | String | 否 |
响应
返回:FlagCommentPublic200Response
示例

创建租户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_tenant_body | models::CreateTenantBody | 是 |
响应
示例

删除租户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| sure | String | 否 |
响应
返回: FlagCommentPublic200Response
示例

获取租户 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | Yes | |
| id | String | Yes |
响应
示例

获取租户列表 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| meta | String | 否 | |
| skip | f64 | 否 |
响应
示例

更新租户 
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_tenant_body | models::UpdateTenantBody | 是 |
响应
返回:FlagCommentPublic200Response
示例

上传图片 
上传并调整图片大小
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| file | std::path::PathBuf | 是 | |
| size_preset | models::SizePreset | 否 | |
| url_id | String | 否 |
响应
获取用户徽章进度列表 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| user_id | String | 否 | |
| limit | f64 | 否 | |
| skip | f64 | 否 |
响应
返回: GetUserBadgeProgressList200Response
创建用户徽章 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| create_user_badge_params | models::CreateUserBadgeParams | 是 |
响应
返回: CreateUserBadge200Response
获取用户徽章列表 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| user_id | String | 否 | |
| badge_id | String | 否 | |
| displayed_on_comments | bool | 否 | |
| limit | f64 | 否 | |
| skip | f64 | 否 |
响应
更新用户徽章 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| update_user_badge_params | models::UpdateUserBadgeParams | 是 |
响应
返回: UpdateUserBadge200Response
获取用户通知 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| page_size | i32 | 否 | |
| after_id | String | 否 | |
| include_context | bool | 否 | |
| after_created_at | i64 | 否 | |
| unread_only | bool | 否 | |
| dm_only | bool | 否 | |
| no_dm | bool | 否 | |
| include_translations | bool | 否 | |
| sso | String | 否 |
响应
返回: GetUserNotifications200Response
重置用户通知 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| after_id | String | 否 | |
| after_created_at | i64 | 否 | |
| unread_only | bool | 否 | |
| dm_only | bool | 否 | |
| no_dm | bool | 否 | |
| sso | String | 否 |
响应
返回: ResetUserNotifications200Response
更新用户评论订阅状态 
为特定评论启用或禁用通知。
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| notification_id | String | 是 | |
| opted_in_or_out | String | 是 | |
| comment_id | String | 是 | |
| sso | String | 否 |
响应
返回:UpdateUserNotificationStatus200Response
更新用户页面订阅状态 
启用或禁用页面的通知。当用户订阅页面时,会为新的根评论创建通知,并且
参数
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| url | String | 是 | |
| page_title | String | 是 | |
| subscribed_or_unsubscribed | String | 是 | |
| sso | String | 否 |
响应
更新用户通知状态 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| notification_id | String | 是 | |
| new_status | String | 是 | |
| sso | String | 否 |
响应
返回: UpdateUserNotificationStatus200Response
获取用户在线状态 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id_ws | String | 是 | |
| user_ids | String | 是 |
响应
返回: GetUserPresenceStatuses200Response
搜索用户 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| username_starts_with | String | 是 | |
| mention_group_ids | Vec |
否 | |
| sso | String | 否 |
响应
获取用户 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 |
响应
示例

创建投票 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| comment_id | String | 是 | |
| direction | String | 是 | |
| user_id | String | 否 | |
| anon_user_id | String | 否 |
响应
示例

删除投票 
参数
| 名称 | 类型 | 必需 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| id | String | 是 | |
| edit_key | String | 否 |
响应
返回: DeleteCommentVote200Response
示例

获取投票 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 |
响应
示例

获取用户的投票 
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| tenant_id | String | 是 | |
| url_id | String | 是 | |
| user_id | String | 否 | |
| anon_user_id | String | 否 |
响应
返回: GetVotesForUser200Response
示例

需要帮助?
如果您在使用 Rust SDK 时遇到任何问题或有疑问,请:
贡献
欢迎贡献!请访问 GitHub 仓库 以查看贡献指南。