
語言 🇹🇼 繁體中文
入門
文件
API 參考
備註
彙總
稽核日誌
留言封鎖
檢查被封鎖的留言
留言
網域設定
電子郵件範本
事件記錄
動態貼文
檢舉留言
話題標籤
管理員
通知數量
通知
頁面
待處理的Webhook事件
問題設定
問題結果
問題結果彙總
SSO 使用者
訂閱
租戶每日使用量
租戶方案
租戶使用者
租戶
上傳圖片
使用者徽章進度
使用者徽章
使用者通知
使用者在線狀態
使用者搜尋
使用者
投票
FastComments Swift SDK
這是 FastComments 的官方 Swift SDK。
FastComments API 的官方 Swift SDK
儲存庫
Installation 
Swift 套件管理器
將以下內容加入你的 Package.swift 檔案:
dependencies: [
.package(url: "https://github.com/fastcomments/fastcomments-swift.git", from: "0.0.1")
]
或在 Xcode:
- 檔案 > 加入套件...
- 輸入儲存庫 URL:
https://github.com/fastcomments/fastcomments-swift.git - 選擇你要使用的版本
系統需求
- Swift 5.9+
- iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+
Library Contents 
FastComments Swift SDK 由數個模組組成:
Client Module - 為 FastComments REST APIs 自動產生的 API 用戶端
- 所有 API 模型的完整型別定義
- 同時包含已授權的 (
DefaultAPI) 與公開的 (PublicAPI) 端點 - 完整的 async/await 支援
- 詳細 API 文件請見 client/README.md
SSO Module - 伺服器端單一登入工具
- 用於使用者驗證的安全 token 生成
- 支援簡易與安全兩種 SSO 模式
- 使用 CryptoKit 進行以 HMAC-SHA256 為基礎的 token 簽名
Quick Start 
使用公開 API
import FastCommentsSwift
// 建立 API 用戶端
let publicApi = PublicAPI()
// Fetch comments for a page
do {
let response = try await publicApi.getCommentsPublic(
tenantId: "your-tenant-id",
urlId: "page-url-id"
)
print("Found \(response.comments?.count ?? 0) comments")
for comment in response.comments ?? [] {
print("Comment: \(comment.comment ?? "")")
}
} catch {
print("Error fetching comments: \(error)")
}
使用已驗證的 API
import FastCommentsSwift
// 使用 API 金鑰建立設定
let defaultApi = DefaultAPI()
defaultApi.apiKey = "your-api-key"
// Fetch comments using authenticated API
do {
let response = try await defaultApi.getComments(
tenantId: "your-tenant-id",
urlId: "page-url-id"
)
print("Total comments: \(response.count ?? 0)")
for comment in response.comments ?? [] {
print("Comment ID: \(comment.id ?? ""), Text: \(comment.comment ?? "")")
}
} catch {
print("Error: \(error)")
}
使用 SSO 進行驗證
安全 SSO(建議用於生產環境)
import FastCommentsSwift
let apiKey = "your-api-key"
// 建立安全 SSO 使用者資料(僅限伺服器端!)
let userData = SecureSSOUserData(
id: "user-123", // 使用者 ID
email: "user@example.com", // 電子郵件
username: "johndoe", // 使用者名稱
avatar: "https://example.com/avatar.jpg" // 頭像 URL
)
// 產生 SSO 令牌
do {
let sso = try FastCommentsSSO.createSecure(apiKey: apiKey, secureSSOUserData: userData)
let token = try sso.createToken()
print("SSO Token: \(token ?? "")")
// 將此令牌傳給前端以進行驗證
} catch {
print("Error creating SSO token: \(error)")
}
簡易 SSO(用於開發/測試)
import FastCommentsSwift
// 建立簡易 SSO 使用者資料(不需 API 金鑰)
let userData = SimpleSSOUserData(
username: "johndoe",
email: "user@example.com",
avatar: "https://example.com/avatar.jpg"
)
// 產生簡易 SSO 令牌
let sso = FastCommentsSSO.createSimple(simpleSSOUserData: userData)
do {
let token = try sso.createToken()
print("Simple SSO Token: \(token ?? "")")
} catch {
print("Error creating SSO token: \(error)")
}
Public vs Secured APIs 
FastComments SDK 提供兩種類型的 API 端點:
PublicAPI - 客戶端安全端點
The PublicAPI 包含可安全從客戶端程式碼(iOS/macOS 應用程式)呼叫的端點。這些端點:
- 不需要 API 金鑰
- 可以使用 SSO tokens 進行驗證
- 對每個使用者/裝置實施速率限制
- 適用於面向終端使用者的應用程式
範例用途: 在您的 iOS 應用程式中擷取和建立評論
DefaultAPI - 伺服器端端點
The DefaultAPI 包含需要 API 金鑰的已驗證端點。這些端點:
- 需要您的 FastComments API 金鑰
- 僅應從伺服器端程式碼呼叫
- 提供對您的 FastComments 資料的完整存取
- 以租戶為單位實施速率限制
範例用途: 管理操作、批次資料匯出、審核工具
重要: 絕不要在客戶端程式碼中暴露您的 API 金鑰。API 金鑰應僅用於伺服器端。
Making API Calls 
Swift SDK 對所有 API 呼叫使用現代的 async/await 語法:
let response = try await publicApi.getCommentsPublic(
tenantId: "your-tenant-id",
urlId: "page-url-id"
)
Common Issues 
401 Unauthorized Errors
If you're getting 401 errors when using the authenticated API:
- Check your API key: Ensure you're using the correct API key from your FastComments dashboard
- Verify the tenant ID: Make sure the tenant ID matches your account
- API key format: The API key should be set on the API client:
let defaultApi = DefaultAPI()
defaultApi.apiKey = "YOUR_API_KEY"
- Using the wrong API: Make sure you're using
DefaultAPI(notPublicAPI) for authenticated calls
SSO Token Issues
If SSO tokens aren't working:
- Use secure mode for production: Always use
FastCommentsSSO.createSecure()with your API key for production - Server-side only: Generate secure SSO tokens on your server, never expose your API key to clients
- Check user data: Ensure all required fields (id, email, username) are provided
- Token expiration: Secure SSO tokens include a timestamp and may expire. Generate fresh tokens as needed.
SSL/TLS Errors
If you encounter SSL/TLS errors:
- Ensure your app's Info.plist allows HTTPS connections to fastcomments.com
- Check that you're not using App Transport Security exceptions that might block the connection
Notes 
廣播 ID
在某些 API 呼叫中,你會看到需要傳遞 broadcastId。當你接收到事件時,會回傳這個 ID,因此如果你打算在用戶端採取樂觀更新(你可能會想這麼做,因為這能提供最佳體驗),你就可以藉此知道要忽略該事件。請在此處傳遞一個 UUID。該 ID 應足夠唯一,以避免在一次會話中出現重複。
let broadcastId = UUID().uuidString
aggregate 
將文件透過分組(若提供 groupBy)並套用多種運算進行彙總。支援不同的運算(例如 sum、countDistinct、avg 等)。
參數
| 名稱 | 類型 | 位置 | 必要 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| parentTenantId | string | query | 否 | |
| includeStats | boolean | query | 否 |
回應
範例

getAuditLogs 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| limit | number | query | 否 | |
| skip | number | query | 否 | |
| order | string | query | 否 | |
| after | number | query | 否 | |
| before | number | query | 否 |
回應
範例

blockFromCommentPublic 
Parameters
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| commentId | string | path | Yes | |
| sso | string | query | No |
Response
回傳: BlockFromCommentPublic200Response
範例

unBlockCommentPublic 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| commentId | string | path | 是 | |
| sso | string | query | 否 |
回應
回傳: UnBlockCommentPublic200Response
範例

checkedCommentsForBlocked 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| commentIds | string | query | Yes | 由逗號分隔的評論 ID 列表。 |
| sso | string | query | No |
回應
回傳: CheckedCommentsForBlocked200Response
範例

blockUserFromComment 
參數
| 名稱 | 型別 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| userId | string | query | 否 | |
| anonUserId | string | query | 否 |
回應
回傳:BlockFromCommentPublic200Response
範例

createCommentPublic 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| urlId | string | query | 是 | |
| broadcastId | string | query | 是 | |
| sessionId | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳: CreateCommentPublic200Response
範例

deleteComment 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes | |
| contextUserId | string | query | No | |
| isLive | boolean | query | No |
回應
範例

deleteCommentPublic 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| commentId | string | path | 是 | |
| broadcastId | string | query | 是 | |
| editKey | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳: DeleteCommentPublic200Response
範例

deleteCommentVote 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| commentId | string | path | 是 | |
| voteId | string | path | 是 | |
| urlId | string | query | 是 | |
| broadcastId | string | query | 是 | |
| editKey | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳: DeleteCommentVote200Response
範例

flagComment 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| userId | string | query | 否 | |
| anonUserId | string | query | 否 |
回應
範例

getComment 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
範例

getComments 
參數
| 名稱 | 型別 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| page | integer | query | 否 | |
| limit | integer | query | 否 | |
| skip | integer | query | 否 | |
| asTree | boolean | query | 否 | |
| skipChildren | integer | query | 否 | |
| limitChildren | integer | query | 否 | |
| maxTreeDepth | integer | query | 否 | |
| urlId | string | query | 否 | |
| userId | string | query | 否 | |
| anonUserId | string | query | 否 | |
| contextUserId | string | query | 否 | |
| hashTag | string | query | 否 | |
| parentId | string | query | 否 | |
| direction | string | query | 否 |
回應
範例

getCommentsPublic 
req tenantId urlId
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| urlId | string | query | 是 | |
| page | integer | query | 否 | |
| direction | string | query | 否 | |
| sso | string | query | 否 | |
| skip | integer | query | 否 | |
| skipChildren | integer | query | 否 | |
| limit | integer | query | 否 | |
| limitChildren | integer | query | 否 | |
| countChildren | boolean | query | 否 | |
| fetchPageForCommentId | string | query | 否 | |
| includeConfig | boolean | query | 否 | |
| countAll | boolean | query | 否 | |
| includei10n | boolean | query | 否 | |
| locale | string | query | 否 | |
| modules | string | query | 否 | |
| isCrawler | boolean | query | 否 | |
| includeNotificationCount | boolean | query | 否 | |
| asTree | boolean | query | 否 | |
| maxTreeDepth | integer | query | 否 | |
| useFullTranslationIds | boolean | query | 否 | |
| parentId | string | query | 否 | |
| searchText | string | query | 否 | |
| hashTags | array | query | 否 | |
| userId | string | query | 否 | |
| customConfigStr | string | query | 否 | |
| afterCommentId | string | query | 否 | |
| beforeCommentId | string | query | 否 |
回應
回傳: GetCommentsPublic200Response
範例

getCommentText 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| commentId | string | path | 是 | |
| editKey | string | query | 否 | |
| sso | string | query | 否 |
回應
範例

getCommentVoteUserNames 
參數
| 名稱 | Type | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | Yes | |
| commentId | string | path | Yes | |
| dir | integer | query | Yes | |
| sso | string | query | No |
回應
回傳: GetCommentVoteUserNames200Response
範例

lockComment 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | path | Yes | |
| commentId | string | path | Yes | |
| broadcastId | string | query | Yes | |
| sso | string | query | No |
回應
範例

pinComment 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| commentId | string | path | 是 | |
| broadcastId | string | query | 是 | |
| sso | string | query | 否 |
回應
範例

saveComment 
參數
| 名稱 | 類型 | Location | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| isLive | boolean | query | 否 | |
| doSpamCheck | boolean | query | 否 | |
| sendEmails | boolean | query | 否 | |
| populateNotifications | boolean | query | 否 |
Response
範例

saveCommentsBulk 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| isLive | boolean | query | 否 | |
| doSpamCheck | boolean | query | 否 | |
| sendEmails | boolean | query | 否 | |
| populateNotifications | boolean | query | 否 |
回傳
範例

setCommentText 
參數
| 名稱 | 類型 | Location | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| commentId | string | path | 是 | |
| broadcastId | string | query | 是 | |
| editKey | string | query | 否 | |
| sso | string | query | 否 |
回應
範例

unBlockUserFromComment 
參數
| 名稱 | 型別 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| userId | string | query | 否 | |
| anonUserId | string | query | 否 |
回應
回傳:UnBlockCommentPublic200Response
範例

unFlagComment 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes | |
| userId | string | query | No | |
| anonUserId | string | query | No |
回應
範例

unLockComment 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | Yes | |
| commentId | string | path | Yes | |
| broadcastId | string | query | Yes | |
| sso | string | query | No |
回應
範例

unPinComment 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | Yes | |
| commentId | string | path | Yes | |
| broadcastId | string | query | Yes | |
| sso | string | query | No |
回應
範例

updateComment 
參數
| 名稱 | 型別 | 位置 | 是否必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| contextUserId | string | query | 否 | |
| doSpamCheck | boolean | query | 否 | |
| isLive | boolean | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

voteComment 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | Yes | |
| commentId | string | path | Yes | |
| urlId | string | query | Yes | |
| broadcastId | string | query | Yes | |
| sessionId | string | query | No | |
| sso | string | query | No |
回應
範例

addDomainConfig 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: AddDomainConfig200Response
範例

deleteDomainConfig 
參數
| 名稱 | 類型 | 位置 | 必要 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| domain | string | path | Yes |
回應
回傳: DeleteDomainConfig200Response
範例

getDomainConfig 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| domain | string | path | 是 |
回應
回傳: GetDomainConfig200Response
範例

getDomainConfigs 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes |
回應
回傳: GetDomainConfigs200Response
範例

patchDomainConfig 
參數
| 名稱 | 類型 | 位置 | 必需 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| domainToUpdate | string | path | 是 |
回應
回傳: GetDomainConfig200Response
範例

putDomainConfig 
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| domainToUpdate | string | path | Yes |
Response
Returns: GetDomainConfig200Response
Example

createEmailTemplate 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: CreateEmailTemplate200Response
範例

deleteEmailTemplate 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

deleteEmailTemplateRenderError 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| errorId | string | path | 是 |
回應
Returns: FlagCommentPublic200Response
範例

getEmailTemplate 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: GetEmailTemplate200Response
範例

getEmailTemplateDefinitions 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: GetEmailTemplateDefinitions200Response
範例

getEmailTemplateRenderErrors 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| skip | number | query | 否 |
回應
回傳: GetEmailTemplateRenderErrors200Response
範例

getEmailTemplates 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| skip | number | query | 否 |
回應
回傳: GetEmailTemplates200Response
範例

renderEmailTemplate 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| locale | string | query | 否 |
回應
回傳: RenderEmailTemplate200Response
範例

updateEmailTemplate 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

getEventLog 
req tenantId urlId userIdWS
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| urlId | string | query | 是 | |
| userIdWS | string | query | 是 | |
| startTime | integer | query | 是 | |
| endTime | integer | query | 是 |
Response
Example

getGlobalEventLog 
req tenantId urlId userIdWS
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| urlId | string | query | 是 | |
| userIdWS | string | query | 是 | |
| startTime | integer | query | 是 | |
| endTime | integer | query | 是 |
回應
範例

createFeedPost 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| broadcastId | string | query | 否 | |
| isLive | boolean | query | 否 | |
| doSpamCheck | boolean | query | 否 | |
| skipDupCheck | boolean | query | 否 |
回應
範例

createFeedPostPublic 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| broadcastId | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳:CreateFeedPostPublic200Response
範例

deleteFeedPostPublic 
參數
| 名稱 | 類型 | Location | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| postId | string | path | 是 | |
| broadcastId | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳: DeleteFeedPostPublic200Response
範例

getFeedPosts 
req tenantId afterId
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| afterId | string | query | 否 | |
| limit | integer | query | 否 | |
| tags | array | query | 否 |
回應
範例

getFeedPostsPublic 
req tenantId afterId
參數
| 名稱 | 型別 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| afterId | string | query | 否 | |
| limit | integer | query | 否 | |
| tags | array | query | 否 | |
| sso | string | query | 否 | |
| isCrawler | boolean | query | 否 | |
| includeUserInfo | boolean | query | 否 |
回應
回傳: GetFeedPostsPublic200Response
範例

getFeedPostsStats 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| postIds | array | query | 是 | |
| sso | string | query | 否 |
回應
回傳: GetFeedPostsStats200Response
範例

getUserReactsPublic 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | 路徑 | 是 | |
| postIds | array | 查詢 | 否 | |
| sso | string | 查詢 | 否 |
回應
回傳: GetUserReactsPublic200Response
範例

reactFeedPostPublic 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| postId | string | path | 是 | |
| isUndo | boolean | query | 否 | |
| broadcastId | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳: ReactFeedPostPublic200Response
範例

updateFeedPost 
參數
| 名稱 | 型別 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳:FlagCommentPublic200Response
範例

updateFeedPostPublic 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| postId | string | path | 是 | |
| broadcastId | string | query | 否 | |
| sso | string | query | 否 |
回應
回傳: CreateFeedPostPublic200Response
範例

flagCommentPublic 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| commentId | string | path | 是 | |
| isFlagged | boolean | query | 是 | |
| sso | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

addHashTag 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 否 |
回應
範例

addHashTagsBulk 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 否 |
回傳
回傳: AddHashTagsBulk200Response
範例

deleteHashTag 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tag | string | path | 是 | |
| tenantId | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

getHashTags 
參數
| 名稱 | Type | Location | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| page | number | query | 否 |
回應
範例

patchHashTag 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tag | string | path | 是 | |
| tenantId | string | query | 否 |
回應
範例

createModerator 
參數
| 名稱 | 型別 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
範例

deleteModerator 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| sendEmail | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

getModerator 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
範例

getModerators 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| skip | number | query | 否 |
回應
範例

sendInvite 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes | |
| fromName | string | query | Yes |
回應
回傳: FlagCommentPublic200Response
範例

updateModerator 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes |
回應
返回: FlagCommentPublic200Response
範例

deleteNotificationCount 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳:FlagCommentPublic200Response
範例

getCachedNotificationCount 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes |
回應
回傳: GetCachedNotificationCount200Response
範例

getNotificationCount 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| userId | string | query | 否 | |
| urlId | string | query | 否 | |
| fromCommentId | string | query | 否 | |
| viewed | boolean | query | 否 | |
| type | string | query | 否 |
回應
回傳: GetNotificationCount200Response
範例

getNotifications 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| userId | string | query | 否 | |
| urlId | string | query | 否 | |
| fromCommentId | string | query | 否 | |
| viewed | boolean | query | 否 | |
| type | string | query | 否 | |
| skip | number | query | 否 |
回應
回傳值: GetNotifications200Response
範例

updateNotification 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| userId | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

addPage 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
範例

deletePage 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回傳
Returns: DeletePageAPIResponse
範例

getPageByURLId 
參數
| 名稱 | Type | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | 查詢 | 是 | |
| urlId | string | 查詢 | 是 |
回應
範例

getPages 
參數
| 名稱 | 型別 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
範例

patchPage 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes |
回傳
範例

deletePendingWebhookEvent 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

getPendingWebhookEventCount 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| commentId | string | query | 否 | |
| externalId | string | query | 否 | |
| eventType | string | query | 否 | |
| type | string | query | 否 | |
| domain | string | query | 否 | |
| attemptCountGT | number | query | 否 |
回應
回傳: GetPendingWebhookEventCount200Response
範例

getPendingWebhookEvents 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | 查詢 | 是 | |
| commentId | string | 查詢 | 否 | |
| externalId | string | 查詢 | 否 | |
| eventType | string | 查詢 | 否 | |
| type | string | 查詢 | 否 | |
| domain | string | 查詢 | 否 | |
| attemptCountGT | number | 查詢 | 否 | |
| skip | number | 查詢 | 否 |
回應
回傳: GetPendingWebhookEvents200Response
範例

createQuestionConfig 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: CreateQuestionConfig200Response
範例

deleteQuestionConfig 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

getQuestionConfig 
參數
| 名稱 | 類型 | 所在位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳:GetQuestionConfig200Response
範例

getQuestionConfigs 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| skip | number | query | 否 |
回傳
回傳: GetQuestionConfigs200Response
範例

updateQuestionConfig 
參數
| 名稱 | 類型 | 位置 | 是否必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

createQuestionResult 
參數
| 名稱 | Type | Location | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: CreateQuestionResult200Response
範例

deleteQuestionResult 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

getQuestionResult 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳:GetQuestionResult200Response
範例

getQuestionResults 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| urlId | string | query | 否 | |
| userId | string | query | 否 | |
| startDate | string | query | 否 | |
| questionId | string | query | 否 | |
| questionIds | string | query | 否 | |
| skip | number | query | 否 |
回應
回傳: GetQuestionResults200Response
範例

updateQuestionResult 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

aggregateQuestionResults 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| questionId | string | query | 否 | |
| questionIds | array | query | 否 | |
| urlId | string | query | 否 | |
| timeBucket | string | query | 否 | |
| startDate | string | query | 否 | |
| forceRecalculate | boolean | query | 否 |
回應
回傳: AggregateQuestionResults200Response
範例

bulkAggregateQuestionResults 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| forceRecalculate | boolean | query | No |
回應
Returns: BulkAggregateQuestionResults200Response
範例

combineCommentsWithQuestionResults 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| questionId | string | query | 否 | |
| questionIds | array | query | 否 | |
| urlId | string | query | 否 | |
| startDate | string | query | 否 | |
| forceRecalculate | boolean | query | 否 | |
| minValue | number | query | 否 | |
| maxValue | number | query | 否 | |
| limit | number | query | 否 |
回應
回傳: CombineCommentsWithQuestionResults200Response
範例

addSSOUser 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
範例

deleteSSOUser 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| deleteComments | boolean | query | 否 | |
| commentDeleteMode | string | query | 否 |
回應
範例

getSSOUserByEmail 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| string | path | Yes |
回應
回傳: GetSSOUserByEmailAPIResponse
範例

getSSOUserById 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
範例

getSSOUsers 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| skip | integer | query | 否 |
回應
範例

patchSSOUser 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes | |
| updateComments | boolean | query | No |
回應
範例

putSSOUser 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| updateComments | boolean | query | 否 |
回應
範例

createSubscription 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | Yes |
回應
回傳: CreateSubscriptionAPIResponse
範例

deleteSubscription 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| userId | string | query | 否 |
回應
回傳: DeleteSubscriptionAPIResponse
範例

getSubscriptions 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| userId | string | query | 否 |
回應
回傳: GetSubscriptionsAPIResponse
範例

getTenantDailyUsages 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| yearNumber | number | query | 否 | |
| monthNumber | number | query | 否 | |
| dayNumber | number | query | 否 | |
| skip | number | query | 否 |
回應
回傳: GetTenantDailyUsages200Response
範例

createTenantPackage 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: CreateTenantPackage200Response
範例

deleteTenantPackage 
參數
| 名稱 | 型別 | 位置 | 必要 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

getTenantPackage 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes |
回應
回傳: GetTenantPackage200Response
範例

getTenantPackages 
參數
| 名稱 | 型別 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| skip | number | query | No |
回應
回傳: GetTenantPackages200Response
範例

replaceTenantPackage 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes |
回應
回傳: FlagCommentPublic200Response
範例

updateTenantPackage 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

createTenantUser 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
回傳: CreateTenantUser200Response
範例

deleteTenantUser 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| deleteComments | string | query | 否 | |
| commentDeleteMode | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

getTenantUser 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
範例

getTenantUsers 
參數
| 名稱 | 類型 | 位置 | 必要 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| skip | number | query | 否 |
回應
範例

replaceTenantUser 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| updateComments | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

sendLoginLink 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| redirectURL | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

updateTenantUser 
參數
| 名稱 | Type | Location | 必需 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| updateComments | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

createTenant 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回應
範例

deleteTenant 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| sure | string | query | 否 |
回應
回傳: FlagCommentPublic200Response
範例

getTenant 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
範例

getTenants 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| meta | string | query | No | |
| skip | number | query | No |
回應
範例

updateTenant 
參數
| 名稱 | Type | Location | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: FlagCommentPublic200Response
範例

uploadImage 
上傳並調整圖片大小
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | path | Yes | |
| sizePreset | string | query | No | 大小預設: "Default" (1000x1000px) 或 "CrossPlatform" (為常用裝置產生尺寸) |
| urlId | string | query | No | 上傳發生的頁面 ID,用以設定 |
回應
範例

getUserBadgeProgressById 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: GetUserBadgeProgressById200Response
範例

getUserBadgeProgressByUserId 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| userId | string | path | 是 |
回應
回傳:GetUserBadgeProgressById200Response
範例

getUserBadgeProgressList 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| userId | string | query | 否 | |
| limit | number | query | 否 | |
| skip | number | query | 否 |
回應
回傳:GetUserBadgeProgressList200Response
範例

createUserBadge 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 |
回傳
回傳: CreateUserBadge200Response
範例

deleteUserBadge 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: UpdateUserBadge200Response
範例

getUserBadge 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | Yes | |
| id | string | path | Yes |
回應
範例

getUserBadges 
參數
| 名稱 | 型別 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| userId | string | query | 否 | |
| badgeId | string | query | 否 | |
| type | number | query | 否 | |
| displayedOnComments | boolean | query | 否 | |
| limit | number | query | 否 | |
| skip | number | query | 否 |
回應
範例

updateUserBadge 
參數
| 名稱 | 型別 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
回傳: UpdateUserBadge200Response
範例

getUserNotificationCount 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| sso | string | query | 否 |
回應
回傳: GetUserNotificationCount200Response
範例

getUserNotifications 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| pageSize | integer | query | 否 | |
| afterId | string | query | 否 | |
| includeContext | boolean | query | 否 | |
| afterCreatedAt | integer | query | 否 | |
| unreadOnly | boolean | query | 否 | |
| dmOnly | boolean | query | 否 | |
| noDm | boolean | query | 否 | |
| includeTranslations | boolean | query | 否 | |
| sso | string | query | 否 |
回應
回傳: GetUserNotifications200Response
範例

resetUserNotificationCount 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| sso | string | query | 否 |
回應
回傳:ResetUserNotifications200Response
範例

resetUserNotifications 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| afterId | string | query | 否 | |
| afterCreatedAt | integer | query | 否 | |
| unreadOnly | boolean | query | 否 | |
| dmOnly | boolean | query | 否 | |
| noDm | boolean | query | 否 | |
| sso | string | query | 否 |
回應
回傳: ResetUserNotifications200Response
範例

updateUserNotificationCommentSubscriptionStatus 
啟用或停用特定留言的通知。
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| notificationId | string | path | 是 | |
| optedInOrOut | string | path | 是 | |
| commentId | string | query | 是 | |
| sso | string | query | 否 |
回傳
回傳: UpdateUserNotificationStatus200Response
範例

updateUserNotificationPageSubscriptionStatus 
啟用或停用頁面的通知。當使用者訂閱頁面時,系統會為新的根留言建立通知,並且也會
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| urlId | string | query | 是 | |
| url | string | query | 是 | |
| pageTitle | string | query | 是 | |
| subscribedOrUnsubscribed | string | path | 是 | |
| sso | string | query | 否 |
回應
回傳:UpdateUserNotificationStatus200Response
範例

updateUserNotificationStatus 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| notificationId | string | path | 是 | |
| newStatus | string | path | 是 | |
| sso | string | query | 否 |
回應
回傳: UpdateUserNotificationStatus200Response
範例

getUserPresenceStatuses 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| urlIdWS | string | query | 是 | |
| userIds | string | query | 是 |
回應
回傳:GetUserPresenceStatuses200Response
範例

searchUsers 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | path | 是 | |
| urlId | string | query | 是 | |
| usernameStartsWith | string | query | 是 | |
| mentionGroupIds | array | query | 否 | |
| sso | string | query | 否 |
回應
範例

getUser 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 |
回應
範例

createVote 
參數
| 名稱 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| commentId | string | query | 是 | |
| direction | string | query | 是 | |
| userId | string | query | 否 | |
| anonUserId | string | query | 否 |
回應
範例

deleteVote 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| id | string | path | 是 | |
| editKey | string | query | 否 |
回傳
回傳: DeleteCommentVote200Response
範例

getVotes 
參數
| 名稱 | 類型 | 位置 | 必填 | 描述 |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| urlId | string | query | 是 |
回應
範例

getVotesForUser 
參數
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| tenantId | string | query | 是 | |
| urlId | string | query | 是 | |
| userId | string | query | 否 | |
| anonUserId | string | query | 否 |
回應
回傳: GetVotesForUser200Response
範例

需要幫助?
如果您在使用 Swift SDK 時遇到任何問題或有任何疑問,請:
貢獻
歡迎貢獻!請造訪 GitHub 存放庫 以取得貢獻指南。