FastComments.com

FastComments Ruby SDK


這是 FastComments 的官方 Ruby SDK。

FastComments API 的官方 Ruby SDK

儲存庫

在 GitHub 上檢視


安裝 Internal Link


將這一行加入您應用程式的 Gemfile:

gem 'fastcomments'

然後執行:

bundle install

或使用下列指令自行安裝:

gem install fastcomments

函式庫內容

此函式庫包含已產生的 API 用戶端與 SSO 工具,能使使用 API 更加簡便。

公開與受保護的 API

對於 API 用戶端,有兩個類別,DefaultApiPublicApiDefaultApi 包含需要您的 API 金鑰的方法,而 PublicApi 包含可直接從瀏覽器/行動裝置等

在不需驗證的情況下呼叫的 API。

快速開始 Internal Link

使用已驗證的 API (DefaultApi)

重要: 您必須在發出已驗證請求之前,在 ApiClient 上設定您的 API 金鑰。如果未設定,請求會以 401 錯誤失敗。

require 'fastcomments-client'

# 建立並配置 API 用戶端
config = FastCommentsClient::Configuration.new
api_client = FastCommentsClient::ApiClient.new(config)

# 必須:在此設定您的 API 金鑰(從 FastComments 儀表板取得)
config.api_key['x-api-key'] = 'YOUR_API_KEY_HERE'

# 使用已配置的用戶端建立 API 實例
api = FastCommentsClient::DefaultApi.new(api_client)

# 現在您可以進行已驗證的 API 呼叫
begin
  # 範例:新增 SSO 使用者
  user_data = {
    id: 'user-123',
    email: 'user@example.com',
    displayName: 'John Doe'
  }

  response = api.add_sso_user('YOUR_TENANT_ID', user_data)
  puts "User created: #{response}"

rescue FastCommentsClient::ApiError => e
  puts "Error: #{e.response_body}"
  # 常見錯誤:
  # - 401:API 金鑰遺失或無效
  # - 400:請求驗證失敗
end

使用公開 API (PublicApi)

公開端點不需要驗證:

require 'fastcomments-client'

public_api = FastCommentsClient::PublicApi.new

begin
  response = public_api.get_comments_public(
    tenant_id: 'YOUR_TENANT_ID',
    url_id: 'page-url-id'
  )
  puts response
rescue FastCommentsClient::ApiError => e
  puts e.message
end

常見問題

  1. 401 "missing-api-key" error:請在建立 DefaultApi 實例之前確認已設定 config.api_key['x-api-key'] = 'YOUR_KEY'
  2. Wrong API class:伺服器端的已驗證請求請使用 DefaultApi,用於客戶端/公開請求請使用 PublicApi
  3. Null API key:若 API 金鑰為 null,SDK 會靜默跳過驗證,導致 401 錯誤。

注意事項 Internal Link

廣播 ID

你會看到在某些 API 呼叫中需要傳入 broadcastId。當你收到事件時,會收到這個 ID 作為回傳,因此如果你打算在客戶端樂觀地套用變更,可以用它來判斷是否忽略該事件 (你很可能會想這麼做,因為它提供最佳的體驗)。在此傳入一個 UUID。該 ID 應足夠唯一,不會在同一瀏覽器會話中出現兩次。

SSO (單一登入)

有關 SSO 的範例,請參閱下方。

SSO 使用 Internal Link

簡易 SSO

require 'fastcomments'
require 'fastcomments-client'

# 建立簡易 SSO 令牌
user = FastComments::SSO::SimpleSSOUserData.new(
  user_id: 'user-123',
  email: 'user@example.com',
  avatar: 'https://example.com/avatar.jpg'
)

sso = FastComments::SSO::FastCommentsSSO.new_simple(user)
token = sso.create_token

puts "SSO Token: #{token}"

# 使用 SSO 令牌來進行已驗證的 API 呼叫
config = FastCommentsClient::Configuration.new
api_client = FastCommentsClient::ApiClient.new(config)
public_api = FastCommentsClient::PublicApi.new(api_client)

response = public_api.get_comments_public(
  tenant_id: 'your-tenant-id',
  url_id: 'your-page-url-id',
  sso: token
)

puts "Status: #{response}"

安全 SSO

require 'fastcomments'
require 'fastcomments-client'

# 建立安全 SSO 令牌
user = FastComments::SSO::SecureSSOUserData.new(
  user_id: 'user-123',
  email: 'user@example.com',
  username: 'johndoe',
  avatar: 'https://example.com/avatar.jpg'
)

api_key = 'your-api-key'
sso = FastComments::SSO::FastCommentsSSO.new_secure(api_key, user)
token = sso.create_token

puts "Secure SSO Token: #{token}"

# 使用 SSO 令牌來進行已驗證的 API 呼叫
config = FastCommentsClient::Configuration.new
api_client = FastCommentsClient::ApiClient.new(config)
public_api = FastCommentsClient::PublicApi.new(api_client)

response = public_api.get_comments_public(
  tenant_id: 'your-tenant-id',
  url_id: 'your-page-url-id',
  sso: token
)

puts "Status: #{response}"

彙總 Internal Link

Aggregates documents by grouping them (if groupBy is provided) and applying multiple operations. Different operations (e.g. sum, countDistinct, avg, etc.) are supported.

參數

Name Type Location Required Description
tenantId string query Yes
parentTenantId string query No
includeStats boolean query No

回應

Returns: AggregationResponse

範例

aggregate 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14aggregation_request = FastCommentsClient::AggregationRequest.new({resource_name: 'resource_name_example', operations: [FastCommentsClient::AggregationOperation.new({field: 'field_example', op: FastCommentsClient::AggregationOpType::SUM})]}) # AggregationRequest |
15opts = {
16 parent_tenant_id: 'parent_tenant_id_example', # String |
17 include_stats: true # Boolean |
18}
19
20begin
21
22 result = api_instance.aggregate(tenant_id, aggregation_request, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->aggregate: #{e}"
26end
27

取得稽核日誌 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
limit number query
skip number query
order string query
after number query
before number query

回應

回傳: GetAuditLogs200Response

範例

get_audit_logs 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 limit: 1.2, # Float |
16 skip: 1.2, # Float |
17 order: FastCommentsClient::SORTDIR::ASC, # SORTDIR |
18 after: 1.2, # Float |
19 before: 1.2 # Float |
20}
21
22begin
23
24 result = api_instance.get_audit_logs(tenant_id, opts)
25 p result
26rescue FastCommentsClient::ApiError => e
27 puts "Error when calling DefaultApi->get_audit_logs: #{e}"
28end
29

封鎖公開評論 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query
commentId string path
sso string query

回應

回傳: BlockFromCommentPublic200Response

範例

block_from_comment_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8public_block_from_comment_params = FastCommentsClient::PublicBlockFromCommentParams.new({comment_ids: ['comment_ids_example']}) # PublicBlockFromCommentParams |
9opts = {
10 sso: 'sso_example' # String |
11}
12
13begin
14
15 result = api_instance.block_from_comment_public(tenant_id, comment_id, public_block_from_comment_params, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->block_from_comment_public: #{e}"
19end
20

取消封鎖公開評論 Internal Link

參數

名稱 類型 位置 必要 說明
tenantId string query
commentId string path
sso string query

回應

回傳: UnBlockCommentPublic200Response

範例

un_block_comment_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8public_block_from_comment_params = FastCommentsClient::PublicBlockFromCommentParams.new({comment_ids: ['comment_ids_example']}) # PublicBlockFromCommentParams |
9opts = {
10 sso: 'sso_example' # String |
11}
12
13begin
14
15 result = api_instance.un_block_comment_public(tenant_id, comment_id, public_block_from_comment_params, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->un_block_comment_public: #{e}"
19end
20

檢查被封鎖的評論 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
commentIds string query 以逗號分隔的留言 ID 列表。
sso string query

回應

回傳:CheckedCommentsForBlocked200Response

範例

checked_comments_for_blocked 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_ids = 'comment_ids_example' # String | 以逗號分隔的留言 ID 列表。
8opts = {
9 sso: 'sso_example' # String |
10}
11
12begin
13
14 result = api_instance.checked_comments_for_blocked(tenant_id, comment_ids, opts)
15 p result
16rescue FastCommentsClient::ApiError => e
17 puts "Error when calling PublicApi->checked_comments_for_blocked: #{e}"
18end
19

封鎖使用者(評論) Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string query
id string path
userId string query
anonUserId string query

回應

回傳: BlockFromCommentPublic200Response

範例

block_user_from_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以設定 API 金鑰前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15block_from_comment_params = FastCommentsClient::BlockFromCommentParams.new # BlockFromCommentParams |
16opts = {
17 user_id: 'user_id_example', # String |
18 anon_user_id: 'anon_user_id_example' # String |
19}
20
21begin
22
23 result = api_instance.block_user_from_comment(tenant_id, id, block_from_comment_params, opts)
24 p result
25rescue FastCommentsClient::ApiError => e
26 puts "Error when calling DefaultApi->block_user_from_comment: #{e}"
27end
28

建立公開評論 Internal Link

參數

Name Type Location Required Description
tenantId string path
urlId string query
broadcastId string query
sessionId string query
sso string query

回應

回傳: CreateCommentPublic200Response

範例

create_comment_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7url_id = 'url_id_example' # String |
8broadcast_id = 'broadcast_id_example' # String |
9comment_data = FastCommentsClient::CommentData.new({commenter_name: 'commenter_name_example', comment: 'comment_example', url: 'url_example', url_id: 'url_id_example'}) # CommentData |
10opts = {
11 session_id: 'session_id_example', # String |
12 sso: 'sso_example' # String |
13}
14
15begin
16
17 result = api_instance.create_comment_public(tenant_id, url_id, broadcast_id, comment_data, opts)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling PublicApi->create_comment_public: #{e}"
21end
22

刪除評論 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path
contextUserId string query
isLive boolean query

回應

回傳: DeleteComment200Response

範例

delete_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 context_user_id: 'context_user_id_example', # String |
17 is_live: true # Boolean |
18}
19
20begin
21
22 result = api_instance.delete_comment(tenant_id, id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->delete_comment: #{e}"
26end
27

刪除公開評論 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
commentId string path
broadcastId string query
editKey string query
sso string query

回應

回傳: DeleteCommentPublic200Response

範例

delete_comment_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8broadcast_id = 'broadcast_id_example' # String |
9opts = {
10 edit_key: 'edit_key_example', # String |
11 sso: 'sso_example' # String |
12}
13
14begin
15
16 result = api_instance.delete_comment_public(tenant_id, comment_id, broadcast_id, opts)
17 p result
18rescue FastCommentsClient::ApiError => e
19 puts "Error when calling PublicApi->delete_comment_public: #{e}"
20end
21

刪除評論投票 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
commentId string path
voteId string path
urlId string query
broadcastId string query
editKey string query
sso string query

回應

回傳: DeleteCommentVote200Response

範例

delete_comment_vote 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7comment_id = 'comment_id_example' # 字串 |
8vote_id = 'vote_id_example' # 字串 |
9url_id = 'url_id_example' # 字串 |
10broadcast_id = 'broadcast_id_example' # 字串 |
11opts = {
12 edit_key: 'edit_key_example', # 字串 |
13 sso: 'sso_example' # 字串 |
14}
15
16begin
17
18 result = api_instance.delete_comment_vote(tenant_id, comment_id, vote_id, url_id, broadcast_id, opts)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling PublicApi->delete_comment_vote: #{e}"
22end
23

檢舉評論 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
id string path
userId string query
anonUserId string query

回應

回傳: FlagComment200Response

範例

flag_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 user_id: 'user_id_example', # String |
17 anon_user_id: 'anon_user_id_example' # String |
18}
19
20begin
21
22 result = api_instance.flag_comment(tenant_id, id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->flag_comment: #{e}"
26end
27

取得評論 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path

回應

回傳:GetComment200Response

範例

get_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下一行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_comment(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_comment: #{e}"
22end
23

取得評論內容 Internal Link

參數

Name Type Location Required Description
tenantId string path
commentId string path
editKey string query
sso string query

回應

回傳: GetCommentText200Response

範例

get_comment_text 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7comment_id = 'comment_id_example' # 字串 |
8opts = {
9 edit_key: 'edit_key_example', # 字串 |
10 sso: 'sso_example' # 字串 |
11}
12
13begin
14
15 result = api_instance.get_comment_text(tenant_id, comment_id, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->get_comment_text: #{e}"
19end
20

取得評論投票者名稱 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
commentId string path
dir integer query
sso string query

回應

回傳: GetCommentVoteUserNames200Response

範例

get_comment_vote_user_names 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8dir = 56 # Integer |
9opts = {
10 sso: 'sso_example' # String |
11}
12
13begin
14
15 result = api_instance.get_comment_vote_user_names(tenant_id, comment_id, dir, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->get_comment_vote_user_names: #{e}"
19end
20

取得評論列表 Internal Link

參數

Name Type Location Required Description
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

回應

回傳: GetComments200Response

範例

get_comments 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 page: 56, # Integer |
16 limit: 56, # Integer |
17 skip: 56, # Integer |
18 as_tree: true, # Boolean |
19 skip_children: 56, # Integer |
20 limit_children: 56, # Integer |
21 max_tree_depth: 56, # Integer |
22 url_id: 'url_id_example', # String |
23 user_id: 'user_id_example', # String |
24 anon_user_id: 'anon_user_id_example', # String |
25 context_user_id: 'context_user_id_example', # String |
26 hash_tag: 'hash_tag_example', # String |
27 parent_id: 'parent_id_example', # String |
28 direction: FastCommentsClient::SortDirections::OF # SortDirections |
29}
30
31begin
32
33 result = api_instance.get_comments(tenant_id, opts)
34 p result
35rescue FastCommentsClient::ApiError => e
36 puts "Error when calling DefaultApi->get_comments: #{e}"
37end
38

取得公開評論 Internal Link

req tenantId urlId

參數

Name Type Location Required Description
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

範例

get_comments_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7url_id = 'url_id_example' # String |
8opts = {
9 page: 56, # Integer |
10 direction: FastCommentsClient::SortDirections::OF, # SortDirections |
11 sso: 'sso_example', # String |
12 skip: 56, # Integer |
13 skip_children: 56, # Integer |
14 limit: 56, # Integer |
15 limit_children: 56, # Integer |
16 count_children: true, # Boolean |
17 fetch_page_for_comment_id: 'fetch_page_for_comment_id_example', # String |
18 include_config: true, # Boolean |
19 count_all: true, # Boolean |
20 includei10n: true, # Boolean |
21 locale: 'locale_example', # String |
22 modules: 'modules_example', # String |
23 is_crawler: true, # Boolean |
24 include_notification_count: true, # Boolean |
25 as_tree: true, # Boolean |
26 max_tree_depth: 56, # Integer |
27 use_full_translation_ids: true, # Boolean |
28 parent_id: 'parent_id_example', # String |
29 search_text: 'search_text_example', # String |
30 hash_tags: ['inner_example'], # Array<String> |
31 user_id: 'user_id_example', # String |
32 custom_config_str: 'custom_config_str_example', # String |
33 after_comment_id: 'after_comment_id_example', # String |
34 before_comment_id: 'before_comment_id_example' # String |
35}
36
37begin
38
39 result = api_instance.get_comments_public(tenant_id, url_id, opts)
40 p result
41rescue FastCommentsClient::ApiError => e
42 puts "Error when calling PublicApi->get_comments_public: #{e}"
43end
44

鎖定評論 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string path
commentId string path
broadcastId string query
sso string query

回應

回傳: LockComment200Response

範例

lock_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7comment_id = 'comment_id_example' # 字串 |
8broadcast_id = 'broadcast_id_example' # 字串 |
9opts = {
10 sso: 'sso_example' # 字串 |
11}
12
13begin
14
15 result = api_instance.lock_comment(tenant_id, comment_id, broadcast_id, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->lock_comment: #{e}"
19end
20

置頂評論 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
commentId string path
broadcastId string query
sso string query

回應

回傳:PinComment200Response

範例

pin_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8broadcast_id = 'broadcast_id_example' # String |
9opts = {
10 sso: 'sso_example' # String |
11}
12
13begin
14
15 result = api_instance.pin_comment(tenant_id, comment_id, broadcast_id, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->pin_comment: #{e}"
19end
20

儲存評論 Internal Link


參數

名稱 類型 位置 必填 說明
tenantId string query
isLive boolean query
doSpamCheck boolean query
sendEmails boolean query
populateNotifications boolean query

回應

回傳: SaveComment200Response

範例

save_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer'),請取消註解下列行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_comment_params = FastCommentsClient::CreateCommentParams.new({commenter_name: 'commenter_name_example', comment: 'comment_example', url: 'url_example', url_id: 'url_id_example', locale: 'locale_example'}) # CreateCommentParams |
15opts = {
16 is_live: true, # Boolean |
17 do_spam_check: true, # Boolean |
18 send_emails: true, # Boolean |
19 populate_notifications: true # Boolean |
20}
21
22begin
23
24 result = api_instance.save_comment(tenant_id, create_comment_params, opts)
25 p result
26rescue FastCommentsClient::ApiError => e
27 puts "Error when calling DefaultApi->save_comment: #{e}"
28end
29

批次儲存評論 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
isLive boolean query
doSpamCheck boolean query
sendEmails boolean query
populateNotifications boolean query

回應

回傳: Array&lt;SaveComment200Response&gt;

範例

save_comments_bulk 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_comment_params = [FastCommentsClient::CreateCommentParams.new({commenter_name: 'commenter_name_example', comment: 'comment_example', url: 'url_example', url_id: 'url_id_example', locale: 'locale_example'})] # Array<CreateCommentParams> |
15opts = {
16 is_live: true, # Boolean |
17 do_spam_check: true, # Boolean |
18 send_emails: true, # Boolean |
19 populate_notifications: true # Boolean |
20}
21
22begin
23
24 result = api_instance.save_comments_bulk(tenant_id, create_comment_params, opts)
25 p result
26rescue FastCommentsClient::ApiError => e
27 puts "Error when calling DefaultApi->save_comments_bulk: #{e}"
28end
29

設定評論內容 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
commentId string path
broadcastId string query
editKey string query
sso string query

回應

回傳: SetCommentText200Response

範例

set_comment_text 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8broadcast_id = 'broadcast_id_example' # String |
9comment_text_update_request = FastCommentsClient::CommentTextUpdateRequest.new({comment: 'comment_example'}) # CommentTextUpdateRequest |
10opts = {
11 edit_key: 'edit_key_example', # String |
12 sso: 'sso_example' # String |
13}
14
15begin
16
17 result = api_instance.set_comment_text(tenant_id, comment_id, broadcast_id, comment_text_update_request, opts)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling PublicApi->set_comment_text: #{e}"
21end
22

取消封鎖評論使用者 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path
userId string query
anonUserId string query

回應

回傳: UnBlockCommentPublic200Response

範例

un_block_user_from_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15un_block_from_comment_params = FastCommentsClient::UnBlockFromCommentParams.new # UnBlockFromCommentParams |
16opts = {
17 user_id: 'user_id_example', # String |
18 anon_user_id: 'anon_user_id_example' # String |
19}
20
21begin
22
23 result = api_instance.un_block_user_from_comment(tenant_id, id, un_block_from_comment_params, opts)
24 p result
25rescue FastCommentsClient::ApiError => e
26 puts "Error when calling DefaultApi->un_block_user_from_comment: #{e}"
27end
28

取消檢舉評論 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query
id string path
userId string query
anonUserId string query

回應

回傳: FlagComment200Response

範例

un_flag_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer')(預設為 nil),請取消註解下列一行
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 user_id: 'user_id_example', # String |
17 anon_user_id: 'anon_user_id_example' # String |
18}
19
20begin
21
22 result = api_instance.un_flag_comment(tenant_id, id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->un_flag_comment: #{e}"
26end
27

解鎖評論 Internal Link

參數

Name Type Location Required Description
tenantId string path
commentId string path
broadcastId string query
sso string query

回應

回傳: LockComment200Response

範例

un_lock_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7comment_id = 'comment_id_example' # 字串 |
8broadcast_id = 'broadcast_id_example' # 字串 |
9opts = {
10 sso: 'sso_example' # 字串 |
11}
12
13begin
14
15 result = api_instance.un_lock_comment(tenant_id, comment_id, broadcast_id, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->un_lock_comment: #{e}"
19end
20

取消置頂評論 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
commentId string path
broadcastId string query
sso string query

回應

回傳: PinComment200Response

範例

un_pin_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7comment_id = 'comment_id_example' # String |
8broadcast_id = 'broadcast_id_example' # String |
9opts = {
10 sso: 'sso_example' # String |
11}
12
13begin
14
15 result = api_instance.un_pin_comment(tenant_id, comment_id, broadcast_id, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->un_pin_comment: #{e}"
19end
20

更新評論 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path
contextUserId string query
doSpamCheck boolean query
isLive boolean query

回應

回傳: FlagCommentPublic200Response

範例

update_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15updatable_comment_params = FastCommentsClient::UpdatableCommentParams.new # UpdatableCommentParams |
16opts = {
17 context_user_id: 'context_user_id_example', # String |
18 do_spam_check: true, # Boolean |
19 is_live: true # Boolean |
20}
21
22begin
23
24 result = api_instance.update_comment(tenant_id, id, updatable_comment_params, opts)
25 p result
26rescue FastCommentsClient::ApiError => e
27 puts "Error when calling DefaultApi->update_comment: #{e}"
28end
29

對評論投票 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string path
commentId string path
urlId string query
broadcastId string query
sessionId string query
sso string query

回應

返回: VoteComment200Response

範例

vote_comment 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7comment_id = 'comment_id_example' # 字串 |
8url_id = 'url_id_example' # 字串 |
9broadcast_id = 'broadcast_id_example' # 字串 |
10vote_body_params = FastCommentsClient::VoteBodyParams.new({commenter_email: 'commenter_email_example', commenter_name: 'commenter_name_example', vote_dir: 'up', url: 'url_example'}) # VoteBodyParams |
11opts = {
12 session_id: 'session_id_example', # 字串 |
13 sso: 'sso_example' # 字串 |
14}
15
16begin
17
18 result = api_instance.vote_comment(tenant_id, comment_id, url_id, broadcast_id, vote_body_params, opts)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling PublicApi->vote_comment: #{e}"
22end
23

新增網域設定 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query

回應

回傳: AddDomainConfig200Response

範例

add_domain_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14add_domain_config_params = FastCommentsClient::AddDomainConfigParams.new({domain: 'domain_example'}) # AddDomainConfigParams |
15
16begin
17
18 result = api_instance.add_domain_config(tenant_id, add_domain_config_params)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->add_domain_config: #{e}"
22end
23

刪除網域設定 Internal Link

參數

Name Type Location Required Description
tenantId string query
domain string path

回應

回傳: DeleteDomainConfig200Response

範例

delete_domain_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下面一行以為 API 金鑰設置前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14domain = 'domain_example' # String |
15
16begin
17
18 result = api_instance.delete_domain_config(tenant_id, domain)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_domain_config: #{e}"
22end
23

取得網域設定 Internal Link

參數

名稱 型別 位置 是否必填 說明
tenantId string 查詢
domain string 路徑

回應

回傳: GetDomainConfig200Response

範例

get_domain_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式碼以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14domain = 'domain_example' # String |
15
16begin
17
18 result = api_instance.get_domain_config(tenant_id, domain)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_domain_config: #{e}"
22end
23

取得網域設定列表 Internal Link

參數

Name Type Location Required Description
tenantId string query

回應

回傳: GetDomainConfigs200Response

範例

get_domain_configs 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14
15begin
16
17 result = api_instance.get_domain_configs(tenant_id)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling DefaultApi->get_domain_configs: #{e}"
21end
22

部分更新網域設定 Internal Link

參數

Name Type Location Required Description
tenantId string query
domainToUpdate string path

回應

回傳: GetDomainConfig200Response

範例

patch_domain_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14domain_to_update = 'domain_to_update_example' # String |
15patch_domain_config_params = FastCommentsClient::PatchDomainConfigParams.new # PatchDomainConfigParams |
16
17begin
18
19 result = api_instance.patch_domain_config(tenant_id, domain_to_update, patch_domain_config_params)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->patch_domain_config: #{e}"
23end
24

替換網域設定 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query
domainToUpdate string path

回應

回傳: GetDomainConfig200Response

範例

put_domain_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14domain_to_update = 'domain_to_update_example' # String |
15update_domain_config_params = FastCommentsClient::UpdateDomainConfigParams.new({domain: 'domain_example'}) # UpdateDomainConfigParams |
16
17begin
18
19 result = api_instance.put_domain_config(tenant_id, domain_to_update, update_domain_config_params)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->put_domain_config: #{e}"
23end
24

建立電子郵件範本 Internal Link

參數

Name Type Location Required Description
tenantId string query

回應

回傳: CreateEmailTemplate200Response

範例

create_email_template 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_email_template_body = FastCommentsClient::CreateEmailTemplateBody.new({email_template_id: 'email_template_id_example', display_name: 'display_name_example', ejs: 'ejs_example'}) # CreateEmailTemplateBody |
15
16begin
17
18 result = api_instance.create_email_template(tenant_id, create_email_template_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_email_template: #{e}"
22end
23

刪除電子郵件範本 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

delete_email_template 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列這一行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_email_template(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_email_template: #{e}"
22end
23

刪除電子郵件範本渲染錯誤 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path
errorId string path

回應

回傳: FlagCommentPublic200Response

範例

delete_email_template_render_error 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下面一行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15error_id = 'error_id_example' # String |
16
17begin
18
19 result = api_instance.delete_email_template_render_error(tenant_id, id, error_id)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->delete_email_template_render_error: #{e}"
23end
24

取得電子郵件範本 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path

回應

回傳: GetEmailTemplate200Response

範例

get_email_template 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_email_template(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_email_template: #{e}"
22end
23

取得電子郵件範本定義 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query

回應

回傳: GetEmailTemplateDefinitions200Response

範例

get_email_template_definitions 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下這行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14
15begin
16
17 result = api_instance.get_email_template_definitions(tenant_id)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling DefaultApi->get_email_template_definitions: #{e}"
21end
22

取得電子郵件範本渲染錯誤 Internal Link

參數

名稱 類型 位置 是否必填 描述
tenantId string query Yes
id string path Yes
skip number query No

回應

回傳: GetEmailTemplateRenderErrors200Response

範例

get_email_template_render_errors 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 skip: 1.2 # Float |
17}
18
19begin
20
21 result = api_instance.get_email_template_render_errors(tenant_id, id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->get_email_template_render_errors: #{e}"
25end
26

取得電子郵件範本列表 Internal Link

參數

名稱 類型 位置 必需 描述
tenantId string query Yes
skip number query No

回應

回傳: GetEmailTemplates200Response

範例

get_email_templates 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 密鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下一行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 skip: 1.2 # 浮點數 |
16}
17
18begin
19
20 result = api_instance.get_email_templates(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_email_templates: #{e}"
24end
25

渲染電子郵件範本 Internal Link

參數

Name Type Location Required Description
tenantId string query
locale string query

回應

回傳: RenderEmailTemplate200Response

範例

render_email_template 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式碼以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14render_email_template_body = FastCommentsClient::RenderEmailTemplateBody.new({email_template_id: 'email_template_id_example', ejs: 'ejs_example'}) # RenderEmailTemplateBody |
15opts = {
16 locale: 'locale_example' # String |
17}
18
19begin
20
21 result = api_instance.render_email_template(tenant_id, render_email_template_body, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->render_email_template: #{e}"
25end
26

更新電子郵件範本 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

update_email_template 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_email_template_body = FastCommentsClient::UpdateEmailTemplateBody.new # UpdateEmailTemplateBody |
16
17begin
18
19 result = api_instance.update_email_template(tenant_id, id, update_email_template_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_email_template: #{e}"
23end
24

取得事件日誌 Internal Link

req tenantId urlId userIdWS

參數

Name Type Location Required Description
tenantId string path
urlId string query
userIdWS string query
startTime integer query
endTime integer query

回應

回傳: GetEventLog200Response

範例

get_event_log 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7url_id = 'url_id_example' # 字串 |
8user_id_ws = 'user_id_ws_example' # 字串 |
9start_time = 789 # 整數 |
10end_time = 789 # 整數 |
11
12begin
13
14 result = api_instance.get_event_log(tenant_id, url_id, user_id_ws, start_time, end_time)
15 p result
16rescue FastCommentsClient::ApiError => e
17 puts "Error when calling PublicApi->get_event_log: #{e}"
18end
19

取得全域事件日誌 Internal Link

req tenantId urlId userIdWS

參數

名稱 類型 位置 必填 描述
tenantId string path Yes
urlId string query Yes
userIdWS string query Yes
startTime integer query Yes
endTime integer query Yes

回應

回傳: GetEventLog200Response

範例

get_global_event_log 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7url_id = 'url_id_example' # String |
8user_id_ws = 'user_id_ws_example' # String |
9start_time = 789 # Integer |
10end_time = 789 # Integer |
11
12begin
13
14 result = api_instance.get_global_event_log(tenant_id, url_id, user_id_ws, start_time, end_time)
15 p result
16rescue FastCommentsClient::ApiError => e
17 puts "Error when calling PublicApi->get_global_event_log: #{e}"
18end
19

建立動態文章 Internal Link

參數

Name Type Location Required Description
tenantId string query
broadcastId string query
isLive boolean query
doSpamCheck boolean query
skipDupCheck boolean query

回應

回傳:CreateFeedPost200Response

範例

create_feed_post 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_feed_post_params = FastCommentsClient::CreateFeedPostParams.new # CreateFeedPostParams |
15opts = {
16 broadcast_id: 'broadcast_id_example', # String |
17 is_live: true, # Boolean |
18 do_spam_check: true, # Boolean |
19 skip_dup_check: true # Boolean |
20}
21
22begin
23
24 result = api_instance.create_feed_post(tenant_id, create_feed_post_params, opts)
25 p result
26rescue FastCommentsClient::ApiError => e
27 puts "Error when calling DefaultApi->create_feed_post: #{e}"
28end
29

建立公開動態文章 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string path
broadcastId string query
sso string query

回應

回傳: CreateFeedPostPublic200Response

範例

create_feed_post_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7create_feed_post_params = FastCommentsClient::CreateFeedPostParams.new # CreateFeedPostParams |
8opts = {
9 broadcast_id: 'broadcast_id_example', # String |
10 sso: 'sso_example' # String |
11}
12
13begin
14
15 result = api_instance.create_feed_post_public(tenant_id, create_feed_post_params, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->create_feed_post_public: #{e}"
19end
20

刪除公開動態文章 Internal Link

參數

Name Type Location Required Description
tenantId string path Yes
postId string path Yes
broadcastId string query No
sso string query No

回應

回傳: DeleteFeedPostPublic200Response

範例

delete_feed_post_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7post_id = 'post_id_example' # 字串 |
8opts = {
9 broadcast_id: 'broadcast_id_example', # 字串 |
10 sso: 'sso_example' # 字串 |
11}
12
13begin
14
15 result = api_instance.delete_feed_post_public(tenant_id, post_id, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->delete_feed_post_public: #{e}"
19end
20

取得動態文章列表 Internal Link

req tenantId afterId

參數

Name Type Location Required Description
tenantId string query
afterId string query
limit integer query
tags array query

回應

回傳: GetFeedPosts200Response

範例

get_feed_posts 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 after_id: 'after_id_example', # String |
16 limit: 56, # Integer |
17 tags: ['inner_example'] # Array<String> |
18}
19
20begin
21
22 result = api_instance.get_feed_posts(tenant_id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->get_feed_posts: #{e}"
26end
27

取得公開動態文章 Internal Link

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

範例

get_feed_posts_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7opts = {
8 after_id: 'after_id_example', # String |
9 limit: 56, # Integer |
10 tags: ['inner_example'], # Array<String> |
11 sso: 'sso_example', # String |
12 is_crawler: true, # Boolean |
13 include_user_info: true # Boolean |
14}
15
16begin
17
18 result = api_instance.get_feed_posts_public(tenant_id, opts)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling PublicApi->get_feed_posts_public: #{e}"
22end
23

取得動態文章統計 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
postIds array query
sso string query

回應

回傳: GetFeedPostsStats200Response

範例

get_feed_posts_stats 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7post_ids = ['inner_example'] # 陣列<String> |
8opts = {
9 sso: 'sso_example' # 字串 |
10}
11
12begin
13
14 result = api_instance.get_feed_posts_stats(tenant_id, post_ids, opts)
15 p result
16rescue FastCommentsClient::ApiError => e
17 puts "Error when calling PublicApi->get_feed_posts_stats: #{e}"
18end
19

取得使用者公開反應 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string 路徑
postIds array 查詢
sso string 查詢

回應

回傳: GetUserReactsPublic200Response

範例

get_user_reacts_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7opts = {
8 post_ids: ['inner_example'], # Array<String> |
9 sso: 'sso_example' # String |
10}
11
12begin
13
14 result = api_instance.get_user_reacts_public(tenant_id, opts)
15 p result
16rescue FastCommentsClient::ApiError => e
17 puts "Error when calling PublicApi->get_user_reacts_public: #{e}"
18end
19

對公開動態文章反應 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string path
postId string path
isUndo boolean query
broadcastId string query
sso string query

回應

回傳:ReactFeedPostPublic200Response

範例

react_feed_post_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7post_id = 'post_id_example' # String |
8react_body_params = FastCommentsClient::ReactBodyParams.new # ReactBodyParams |
9opts = {
10 is_undo: true, # Boolean |
11 broadcast_id: 'broadcast_id_example', # String |
12 sso: 'sso_example' # String |
13}
14
15begin
16
17 result = api_instance.react_feed_post_public(tenant_id, post_id, react_body_params, opts)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling PublicApi->react_feed_post_public: #{e}"
21end
22

更新動態文章 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
id string path

回應

回傳:FlagCommentPublic200Response

範例

update_feed_post 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer'),請取消註解下列行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15feed_post = FastCommentsClient::FeedPost.new({_id: '_id_example', tenant_id: 'tenant_id_example', created_at: Time.now}) # FeedPost |
16
17begin
18
19 result = api_instance.update_feed_post(tenant_id, id, feed_post)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_feed_post: #{e}"
23end
24

更新公開動態文章 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string path
postId string path
broadcastId string query
sso string query

回應

回傳:CreateFeedPostPublic200Response

範例

update_feed_post_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7post_id = 'post_id_example' # String |
8update_feed_post_params = FastCommentsClient::UpdateFeedPostParams.new # UpdateFeedPostParams |
9opts = {
10 broadcast_id: 'broadcast_id_example', # String |
11 sso: 'sso_example' # String |
12}
13
14begin
15
16 result = api_instance.update_feed_post_public(tenant_id, post_id, update_feed_post_params, opts)
17 p result
18rescue FastCommentsClient::ApiError => e
19 puts "Error when calling PublicApi->update_feed_post_public: #{e}"
20end
21

檢舉公開評論 Internal Link

參數

Name Type Location Required Description
tenantId string query
commentId string path
isFlagged boolean query
sso string query

回應

回傳:FlagCommentPublic200Response

範例

flag_comment_public 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7comment_id = 'comment_id_example' # 字串 |
8is_flagged = true # 布林值 |
9opts = {
10 sso: 'sso_example' # 字串 |
11}
12
13begin
14
15 result = api_instance.flag_comment_public(tenant_id, comment_id, is_flagged, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->flag_comment_public: #{e}"
19end
20

新增標籤 Internal Link

參數

Name Type Location Required Description
tenantId string query No

回應

回傳: AddHashTag200Response

範例

add_hash_tag 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13opts = {
14 tenant_id: 'tenant_id_example', # String |
15 create_hash_tag_body: FastCommentsClient::CreateHashTagBody.new({tag: 'tag_example'}) # CreateHashTagBody |
16}
17
18begin
19
20 result = api_instance.add_hash_tag(opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->add_hash_tag: #{e}"
24end
25

批次新增標籤 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query No

回應

回傳: AddHashTagsBulk200Response

範例

add_hash_tags_bulk 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13opts = {
14 tenant_id: 'tenant_id_example', # String |
15 bulk_create_hash_tags_body: FastCommentsClient::BulkCreateHashTagsBody.new({tags: [FastCommentsClient::BulkCreateHashTagsBodyTagsInner.new({tag: 'tag_example'})]}) # BulkCreateHashTagsBody |
16}
17
18begin
19
20 result = api_instance.add_hash_tags_bulk(opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->add_hash_tags_bulk: #{e}"
24end
25

刪除標籤 Internal Link

參數

名稱 類型 位置 必填 描述
tag string path Yes
tenantId string query No

回應

回傳:FlagCommentPublic200Response

範例

delete_hash_tag 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tag = 'tag_example' # String |
14opts = {
15 tenant_id: 'tenant_id_example', # String |
16 delete_hash_tag_request: FastCommentsClient::DeleteHashTagRequest.new # DeleteHashTagRequest |
17}
18
19begin
20
21 result = api_instance.delete_hash_tag(tag, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->delete_hash_tag: #{e}"
25end
26

取得標籤列表 Internal Link

參數

Name Type Location Required Description
tenantId string query
page number query

Response

回傳: GetHashTags200Response

範例

get_hash_tags 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 page: 1.2 # Float |
16}
17
18begin
19
20 result = api_instance.get_hash_tags(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_hash_tags: #{e}"
24end
25

部分更新標籤 Internal Link


參數

名稱 類型 位置 必填 說明
tag string path
tenantId string query

回應

回傳: PatchHashTag200Response

範例

patch_hash_tag 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下一行以設定 API 金鑰的前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tag = 'tag_example' # String |
14opts = {
15 tenant_id: 'tenant_id_example', # String |
16 update_hash_tag_body: FastCommentsClient::UpdateHashTagBody.new # UpdateHashTagBody |
17}
18
19begin
20
21 result = api_instance.patch_hash_tag(tag, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->patch_hash_tag: #{e}"
25end
26

建立管理員 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string query

回應

回傳: CreateModerator200Response

範例

create_moderator 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_moderator_body = FastCommentsClient::CreateModeratorBody.new({name: 'name_example', email: 'email_example'}) # CreateModeratorBody |
15
16begin
17
18 result = api_instance.create_moderator(tenant_id, create_moderator_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_moderator: #{e}"
22end
23

刪除管理員 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path
sendEmail string query

回應

回傳: FlagCommentPublic200Response

範例

delete_moderator 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 send_email: 'send_email_example' # String |
17}
18
19begin
20
21 result = api_instance.delete_moderator(tenant_id, id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->delete_moderator: #{e}"
25end
26

取得管理員 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes
id string path Yes

回應

回傳: GetModerator200Response

範例

get_moderator 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# setup authorization
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_moderator(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_moderator: #{e}"
22end
23

取得管理員列表 Internal Link

參數

Name Type Location Required Description
tenantId string query
skip number query

回傳

回傳: GetModerators200Response

範例

get_moderators 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 skip: 1.2 # Float |
16}
17
18begin
19
20 result = api_instance.get_moderators(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_moderators: #{e}"
24end
25

發送邀請 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
id string path
fromName string query

回應

返回:FlagCommentPublic200Response

範例

send_invite 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式碼以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15from_name = 'from_name_example' # String |
16
17begin
18
19 result = api_instance.send_invite(tenant_id, id, from_name)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->send_invite: #{e}"
23end
24

更新管理員 Internal Link

參數

名稱 類型 位置 是否必填 說明
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

update_moderator 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_moderator_body = FastCommentsClient::UpdateModeratorBody.new # UpdateModeratorBody |
16
17begin
18
19 result = api_instance.update_moderator(tenant_id, id, update_moderator_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_moderator: #{e}"
23end
24

刪除通知計數 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query Yes
id string path Yes

回應

回傳: FlagCommentPublic200Response

範例

delete_notification_count 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要設定 API 金鑰的前綴(例如 'Bearer'),請取消註解以下行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_notification_count(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_notification_count: #{e}"
22end
23

取得快取的通知計數 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query
id string path

回應

回傳: GetCachedNotificationCount200Response

範例

get_cached_notification_count 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer'),取消註解下列程式行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_cached_notification_count(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_cached_notification_count: #{e}"
22end
23

取得通知計數 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
userId string query
urlId string query
fromCommentId string query
viewed boolean query
type string query

回應

回傳: GetNotificationCount200Response

範例

get_notification_count 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 解除註解以下這行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 user_id: 'user_id_example', # 字串 |
16 url_id: 'url_id_example', # 字串 |
17 from_comment_id: 'from_comment_id_example', # 字串 |
18 viewed: true, # 布林值 |
19 type: 'type_example' # 字串 |
20}
21
22begin
23
24 result = api_instance.get_notification_count(tenant_id, opts)
25 p result
26rescue FastCommentsClient::ApiError => e
27 puts "Error when calling DefaultApi->get_notification_count: #{e}"
28end
29

取得通知 Internal Link

參數

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

範例

get_notifications 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 user_id: 'user_id_example', # String |
16 url_id: 'url_id_example', # String |
17 from_comment_id: 'from_comment_id_example', # String |
18 viewed: true, # Boolean |
19 type: 'type_example', # String |
20 skip: 1.2 # Float |
21}
22
23begin
24
25 result = api_instance.get_notifications(tenant_id, opts)
26 p result
27rescue FastCommentsClient::ApiError => e
28 puts "Error when calling DefaultApi->get_notifications: #{e}"
29end
30

更新通知 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query Yes
id string path Yes
userId string query No

回應

回傳: FlagCommentPublic200Response

範例

update_notification 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 解除註解以下一行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_notification_body = FastCommentsClient::UpdateNotificationBody.new # UpdateNotificationBody |
16opts = {
17 user_id: 'user_id_example' # String |
18}
19
20begin
21
22 result = api_instance.update_notification(tenant_id, id, update_notification_body, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->update_notification: #{e}"
26end
27

新增頁面 Internal Link

參數

名稱 類型 位置 是否必填 說明
tenantId string query

回應

回傳: AddPageAPIResponse

範例

add_page 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下這行以為 API 金鑰設定前綴, e.g. 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_api_page_data = FastCommentsClient::CreateAPIPageData.new({title: 'title_example', url: 'url_example', url_id: 'url_id_example'}) # CreateAPIPageData |
15
16begin
17
18 result = api_instance.add_page(tenant_id, create_api_page_data)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->add_page: #{e}"
22end
23

刪除頁面 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
id string path

回應

回傳: DeletePageAPIResponse

範例

delete_page 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下這行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_page(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_page: #{e}"
22end
23

以 URL ID 取得頁面 Internal Link

參數

Name Type Location Required Description
tenantId string query
urlId string query

回應

回傳: GetPageByURLIdAPIResponse

範例

get_page_by_urlid 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14url_id = 'url_id_example' # String |
15
16begin
17
18 result = api_instance.get_page_by_urlid(tenant_id, url_id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_page_by_urlid: #{e}"
22end
23

取得頁面列表 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query

回應

回傳: GetPagesAPIResponse

範例

get_pages 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14
15begin
16
17 result = api_instance.get_pages(tenant_id)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling DefaultApi->get_pages: #{e}"
21end
22

部分更新頁面 Internal Link


參數

Name Type Location Required Description
tenantId string query
id string path

回應

回傳: PatchPageAPIResponse

範例

patch_page 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列一行以設定 API 金鑰的前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_api_page_data = FastCommentsClient::UpdateAPIPageData.new # UpdateAPIPageData |
16
17begin
18
19 result = api_instance.patch_page(tenant_id, id, update_api_page_data)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->patch_page: #{e}"
23end
24

刪除待處理的 Webhook 事件 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path

回傳

回傳: FlagCommentPublic200Response

範例

delete_pending_webhook_event 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_pending_webhook_event(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_pending_webhook_event: #{e}"
22end
23

取得待處理 Webhook 事件數量 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes
commentId string query No
externalId string query No
eventType string query No
type string query No
domain string query No
attemptCountGT number query No

回應

回傳: GetPendingWebhookEventCount200Response

範例

get_pending_webhook_event_count 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 comment_id: 'comment_id_example', # String |
16 external_id: 'external_id_example', # String |
17 event_type: 'event_type_example', # String |
18 type: 'type_example', # String |
19 domain: 'domain_example', # String |
20 attempt_count_gt: 1.2 # Float |
21}
22
23begin
24
25 result = api_instance.get_pending_webhook_event_count(tenant_id, opts)
26 p result
27rescue FastCommentsClient::ApiError => e
28 puts "Error when calling DefaultApi->get_pending_webhook_event_count: #{e}"
29end
30

取得待處理的 Webhook 事件 Internal Link

參數

Name Type Location Required Description
tenantId string query
commentId string query
externalId string query
eventType string query
type string query
domain string query
attemptCountGT number query
skip number query

回應

回傳: GetPendingWebhookEvents200Response

範例

get_pending_webhook_events 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 comment_id: 'comment_id_example', # String |
16 external_id: 'external_id_example', # String |
17 event_type: 'event_type_example', # String |
18 type: 'type_example', # String |
19 domain: 'domain_example', # String |
20 attempt_count_gt: 1.2, # Float |
21 skip: 1.2 # Float |
22}
23
24begin
25
26 result = api_instance.get_pending_webhook_events(tenant_id, opts)
27 p result
28rescue FastCommentsClient::ApiError => e
29 puts "Error when calling DefaultApi->get_pending_webhook_events: #{e}"
30end
31

建立問題設定 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query

回應

回傳: CreateQuestionConfig200Response

範例

create_question_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_question_config_body = FastCommentsClient::CreateQuestionConfigBody.new({name: 'name_example', question: 'question_example', type: 'type_example', reporting_order: 3.56}) # CreateQuestionConfigBody |
15
16begin
17
18 result = api_instance.create_question_config(tenant_id, create_question_config_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_question_config: #{e}"
22end
23

刪除問題設定 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳:FlagCommentPublic200Response

範例

delete_question_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要設定 API 金鑰的前綴(例如 'Bearer'),請取消註解下列行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_question_config(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_question_config: #{e}"
22end
23

取得問題設定 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes
id string path Yes

回應

回傳: GetQuestionConfig200Response

範例

get_question_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_question_config(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_question_config: #{e}"
22end
23

取得問題設定列表 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
skip number query

回應

回傳: GetQuestionConfigs200Response

範例

get_question_configs 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 skip: 1.2 # 浮點數 |
16}
17
18begin
19
20 result = api_instance.get_question_configs(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_question_configs: #{e}"
24end
25

更新問題設定 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

update_question_config 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API key 授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API key 設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_question_config_body = FastCommentsClient::UpdateQuestionConfigBody.new # UpdateQuestionConfigBody |
16
17begin
18
19 result = api_instance.update_question_config(tenant_id, id, update_question_config_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_question_config: #{e}"
23end
24

建立問題結果 Internal Link

參數

名稱 類型 位置 必要 描述
tenantId string query

回應

回傳:CreateQuestionResult200Response

範例

create_question_result 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴,請取消註解下列一行,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_question_result_body = FastCommentsClient::CreateQuestionResultBody.new({url_id: 'url_id_example', value: 3.56, question_id: 'question_id_example'}) # CreateQuestionResultBody |
15
16begin
17
18 result = api_instance.create_question_result(tenant_id, create_question_result_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_question_result: #{e}"
22end
23

刪除問題結果 Internal Link

參數

名稱 類型 位置 必需 說明
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

delete_question_result 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_question_result(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_question_result: #{e}"
22end
23

取得問題結果 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query Yes
id string path Yes

回應

回傳: GetQuestionResult200Response

範例

get_question_result 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API key 授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API key 設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_question_result(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_question_result: #{e}"
22end
23

取得問題結果列表 Internal Link

參數

名稱 類型 位置 是否必填 描述
tenantId string query
urlId string query
userId string query
startDate string query
questionId string query
questionIds string query
skip number query

回應

回傳: GetQuestionResults200Response

範例

get_question_results 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 url_id: 'url_id_example', # String |
16 user_id: 'user_id_example', # String |
17 start_date: 'start_date_example', # String |
18 question_id: 'question_id_example', # String |
19 question_ids: 'question_ids_example', # String |
20 skip: 1.2 # Float |
21}
22
23begin
24
25 result = api_instance.get_question_results(tenant_id, opts)
26 p result
27rescue FastCommentsClient::ApiError => e
28 puts "Error when calling DefaultApi->get_question_results: #{e}"
29end
30

更新問題結果 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳:FlagCommentPublic200Response

範例

update_question_result 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列一行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_question_result_body = FastCommentsClient::UpdateQuestionResultBody.new # UpdateQuestionResultBody |
16
17begin
18
19 result = api_instance.update_question_result(tenant_id, id, update_question_result_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_question_result: #{e}"
23end
24

彙總問題結果 Internal Link

參數

Name Type Location Required Description
tenantId string query
questionId string query
questionIds array query
urlId string query
timeBucket string query
startDate string query
forceRecalculate boolean query

回應

回傳: AggregateQuestionResults200Response

範例

aggregate_question_results 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 question_id: 'question_id_example', # String |
16 question_ids: ['inner_example'], # Array<String> |
17 url_id: 'url_id_example', # String |
18 time_bucket: FastCommentsClient::AggregateTimeBucket::DAY, # AggregateTimeBucket |
19 start_date: Time.parse('2013-10-20T19:20:30+01:00'), # Time |
20 force_recalculate: true # Boolean |
21}
22
23begin
24
25 result = api_instance.aggregate_question_results(tenant_id, opts)
26 p result
27rescue FastCommentsClient::ApiError => e
28 puts "Error when calling DefaultApi->aggregate_question_results: #{e}"
29end
30

批次彙總問題結果 Internal Link

參數

名稱 類型 Location 必填 說明
tenantId string query
forceRecalculate boolean query

回應

回傳: BulkAggregateQuestionResults200Response

範例

bulk_aggregate_question_results 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14bulk_aggregate_question_results_request = FastCommentsClient::BulkAggregateQuestionResultsRequest.new({aggregations: [FastCommentsClient::BulkAggregateQuestionItem.new({agg_id: 'agg_id_example'})]}) # BulkAggregateQuestionResultsRequest |
15opts = {
16 force_recalculate: true # Boolean |
17}
18
19begin
20
21 result = api_instance.bulk_aggregate_question_results(tenant_id, bulk_aggregate_question_results_request, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->bulk_aggregate_question_results: #{e}"
25end
26

將評論與問題結果合併 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query Yes
questionId string query No
questionIds array query No
urlId string query No
startDate string query No
forceRecalculate boolean query No
minValue number query No
maxValue number query No
limit number query No

回應

回傳: CombineCommentsWithQuestionResults200Response

範例

combine_comments_with_question_results 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下列以為 API 金鑰設定前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 question_id: 'question_id_example', # String |
16 question_ids: ['inner_example'], # Array<String> |
17 url_id: 'url_id_example', # String |
18 start_date: Time.parse('2013-10-20T19:20:30+01:00'), # Time |
19 force_recalculate: true, # Boolean |
20 min_value: 1.2, # Float |
21 max_value: 1.2, # Float |
22 limit: 1.2 # Float |
23}
24
25begin
26
27 result = api_instance.combine_comments_with_question_results(tenant_id, opts)
28 p result
29rescue FastCommentsClient::ApiError => e
30 puts "Error when calling DefaultApi->combine_comments_with_question_results: #{e}"
31end
32

新增 SSO 使用者 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes

回應

回傳: AddSSOUserAPIResponse

範例

add_sso_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14create_apisso_user_data = FastCommentsClient::CreateAPISSOUserData.new({email: 'email_example', username: 'username_example', id: 'id_example'}) # CreateAPISSOUserData |
15
16begin
17
18 result = api_instance.add_sso_user(tenant_id, create_apisso_user_data)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->add_sso_user: #{e}"
22end
23

刪除 SSO 使用者 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path
deleteComments boolean query
commentDeleteMode string query

回應

回傳:DeleteSSOUserAPIResponse

範例

delete_sso_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下一行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 delete_comments: true, # Boolean |
17 comment_delete_mode: 'comment_delete_mode_example' # String |
18}
19
20begin
21
22 result = api_instance.delete_sso_user(tenant_id, id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->delete_sso_user: #{e}"
26end
27

以電子郵件取得 SSO 使用者 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes
email string path Yes

回應

回傳: GetSSOUserByEmailAPIResponse

範例

get_sso_user_by_email 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式碼以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14email = 'email_example' # String |
15
16begin
17
18 result = api_instance.get_sso_user_by_email(tenant_id, email)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_sso_user_by_email: #{e}"
22end
23

以 ID 取得 SSO 使用者 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string query
id string path

回應

回傳: GetSSOUserByIdAPIResponse

範例

get_sso_user_by_id 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14id = 'id_example' # 字串 |
15
16begin
17
18 result = api_instance.get_sso_user_by_id(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_sso_user_by_id: #{e}"
22end
23

取得 SSO 使用者列表 Internal Link

參數

Name Type Location Required Description
tenantId string query
skip integer query

回應

回傳: GetSSOUsers200Response

範例

get_sso_users 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer',預設為 nil),請取消註解以下行
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 skip: 56 # 整數 |
16}
17
18begin
19
20 result = api_instance.get_sso_users(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_sso_users: #{e}"
24end
25

部分更新 SSO 使用者 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path
updateComments boolean query

回應

回傳: PatchSSOUserAPIResponse

範例

patch_sso_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer',預設為 nil),請取消註解下列行
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_apisso_user_data = FastCommentsClient::UpdateAPISSOUserData.new # UpdateAPISSOUserData |
16opts = {
17 update_comments: true # Boolean |
18}
19
20begin
21
22 result = api_instance.patch_sso_user(tenant_id, id, update_apisso_user_data, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->patch_sso_user: #{e}"
26end
27

替換 SSO 使用者 Internal Link

參數

名稱 Type Location 必填 說明
tenantId string query
id string path
updateComments boolean query

回應

回傳:PutSSOUserAPIResponse

範例

put_sso_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_apisso_user_data = FastCommentsClient::UpdateAPISSOUserData.new # UpdateAPISSOUserData |
16opts = {
17 update_comments: true # Boolean |
18}
19
20begin
21
22 result = api_instance.put_sso_user(tenant_id, id, update_apisso_user_data, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->put_sso_user: #{e}"
26end
27

建立訂閱 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query

回應

回傳:CreateSubscriptionAPIResponse

範例

create_subscription 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer',預設為 nil),請取消註解下方行
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_api_user_subscription_data = FastCommentsClient::CreateAPIUserSubscriptionData.new({url_id: 'url_id_example'}) # CreateAPIUserSubscriptionData |
15
16begin
17
18 result = api_instance.create_subscription(tenant_id, create_api_user_subscription_data)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_subscription: #{e}"
22end
23

刪除訂閱 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
id string path
userId string query

回應

回傳: DeleteSubscriptionAPIResponse

範例

delete_subscription 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 user_id: 'user_id_example' # String |
17}
18
19begin
20
21 result = api_instance.delete_subscription(tenant_id, id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->delete_subscription: #{e}"
25end
26

取得訂閱列表 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
userId string query

回應

回傳: GetSubscriptionsAPIResponse

範例

get_subscriptions 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 user_id: 'user_id_example' # String |
16}
17
18begin
19
20 result = api_instance.get_subscriptions(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_subscriptions: #{e}"
24end
25

取得租戶每日使用量 Internal Link

參數

Name Type Location Required Description
tenantId string query
yearNumber number query
monthNumber number query
dayNumber number query
skip number query

回應

回傳: GetTenantDailyUsages200Response

範例

get_tenant_daily_usages 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 year_number: 1.2, # 浮點數 |
16 month_number: 1.2, # 浮點數 |
17 day_number: 1.2, # 浮點數 |
18 skip: 1.2 # 浮點數 |
19}
20
21begin
22
23 result = api_instance.get_tenant_daily_usages(tenant_id, opts)
24 p result
25rescue FastCommentsClient::ApiError => e
26 puts "Error when calling DefaultApi->get_tenant_daily_usages: #{e}"
27end
28

建立租戶方案 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query

回應

回傳: CreateTenantPackage200Response

範例

create_tenant_package 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_tenant_package_body = FastCommentsClient::CreateTenantPackageBody.new({name: 'name_example', max_monthly_page_loads: 3.56, max_monthly_api_credits: 3.56, max_monthly_comments: 3.56, max_concurrent_users: 3.56, max_tenant_users: 3.56, max_sso_users: 3.56, max_moderators: 3.56, max_domains: 3.56, has_debranding: false, for_who_text: 'for_who_text_example', feature_taglines: ['feature_taglines_example'], has_flex_pricing: false}) # CreateTenantPackageBody |
15
16begin
17
18 result = api_instance.create_tenant_package(tenant_id, create_tenant_package_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_tenant_package: #{e}"
22end
23

刪除租戶方案 Internal Link

參數

名稱 類型 位置 必要 描述
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

delete_tenant_package 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_tenant_package(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_tenant_package: #{e}"
22end
23

取得租戶方案 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string 查詢
id string 路徑

回應

回傳: GetTenantPackage200Response

範例

get_tenant_package 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_tenant_package(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_tenant_package: #{e}"
22end
23

取得租戶方案列表 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
skip number query

回應

回傳:GetTenantPackages200Response

範例

get_tenant_packages 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer'),請取消註解以下行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 skip: 1.2 # 浮點數 |
16}
17
18begin
19
20 result = api_instance.get_tenant_packages(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_tenant_packages: #{e}"
24end
25

替換租戶方案 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

replace_tenant_package 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下一行以為 API 金鑰設置前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15replace_tenant_package_body = FastCommentsClient::ReplaceTenantPackageBody.new({name: 'name_example', monthly_cost_usd: 3.56, yearly_cost_usd: 3.56, max_monthly_page_loads: 3.56, max_monthly_api_credits: 3.56, max_monthly_comments: 3.56, max_concurrent_users: 3.56, max_tenant_users: 3.56, max_sso_users: 3.56, max_moderators: 3.56, max_domains: 3.56, has_debranding: false, for_who_text: 'for_who_text_example', feature_taglines: ['feature_taglines_example'], has_flex_pricing: false}) # ReplaceTenantPackageBody |
16
17begin
18
19 result = api_instance.replace_tenant_package(tenant_id, id, replace_tenant_package_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->replace_tenant_package: #{e}"
23end
24

更新租戶方案 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path

回應

回傳: FlagCommentPublic200Response

範例

update_tenant_package 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_tenant_package_body = FastCommentsClient::UpdateTenantPackageBody.new # UpdateTenantPackageBody |
16
17begin
18
19 result = api_instance.update_tenant_package(tenant_id, id, update_tenant_package_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_tenant_package: #{e}"
23end
24

建立租戶使用者 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes

回應

回傳: CreateTenantUser200Response

範例

create_tenant_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_tenant_user_body = FastCommentsClient::CreateTenantUserBody.new({username: 'username_example', email: 'email_example'}) # CreateTenantUserBody |
15
16begin
17
18 result = api_instance.create_tenant_user(tenant_id, create_tenant_user_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_tenant_user: #{e}"
22end
23

刪除租戶使用者 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path
deleteComments string query
commentDeleteMode string query

回應

回傳: FlagCommentPublic200Response

範例

delete_tenant_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下一行以設定 API 金鑰的前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 delete_comments: 'delete_comments_example', # String |
17 comment_delete_mode: 'comment_delete_mode_example' # String |
18}
19
20begin
21
22 result = api_instance.delete_tenant_user(tenant_id, id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->delete_tenant_user: #{e}"
26end
27

取得租戶使用者 Internal Link


參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳: GetTenantUser200Response

範例

get_tenant_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_tenant_user(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_tenant_user: #{e}"
22end
23

取得租戶使用者列表 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
skip number query

回應

回傳: GetTenantUsers200Response

範例

get_tenant_users 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 skip: 1.2 # Float |
16}
17
18begin
19
20 result = api_instance.get_tenant_users(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_tenant_users: #{e}"
24end
25

替換租戶使用者 Internal Link

參數

名稱 型別 位於 必填 說明
tenantId string query
id string path
updateComments string query

回應

回傳:FlagCommentPublic200Response

範例

replace_tenant_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15replace_tenant_user_body = FastCommentsClient::ReplaceTenantUserBody.new({username: 'username_example', email: 'email_example'}) # ReplaceTenantUserBody |
16opts = {
17 update_comments: 'update_comments_example' # String |
18}
19
20begin
21
22 result = api_instance.replace_tenant_user(tenant_id, id, replace_tenant_user_body, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->replace_tenant_user: #{e}"
26end
27

參數

名稱 類型 位置 必填 描述
tenantId string query
id string path
redirectURL string query

回應

回傳:FlagCommentPublic200Response

範例

send_login_link 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 redirect_url: 'redirect_url_example' # String |
17}
18
19begin
20
21 result = api_instance.send_login_link(tenant_id, id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->send_login_link: #{e}"
25end
26

更新租戶使用者 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path
updateComments string query

回應

回傳: FlagCommentPublic200Response

範例

update_tenant_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_tenant_user_body = FastCommentsClient::UpdateTenantUserBody.new # UpdateTenantUserBody |
16opts = {
17 update_comments: 'update_comments_example' # String |
18}
19
20begin
21
22 result = api_instance.update_tenant_user(tenant_id, id, update_tenant_user_body, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->update_tenant_user: #{e}"
26end
27

建立租戶 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query

回應

回傳: CreateTenant200Response

範例

create_tenant 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API key 授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以設定 API key 的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_tenant_body = FastCommentsClient::CreateTenantBody.new({name: 'name_example', domain_configuration: [FastCommentsClient::APIDomainConfiguration.new({id: 'id_example', domain: 'domain_example', created_at: Time.now})]}) # CreateTenantBody |
15
16begin
17
18 result = api_instance.create_tenant(tenant_id, create_tenant_body)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_tenant: #{e}"
22end
23

刪除租戶 Internal Link

參數

名稱 型別 位置 必填 描述
tenantId string query
id string path
sure string query

回應

回傳: FlagCommentPublic200Response

範例

delete_tenant 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # Configure API key authorization: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 sure: 'sure_example' # String |
17}
18
19begin
20
21 result = api_instance.delete_tenant(tenant_id, id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->delete_tenant: #{e}"
25end
26

取得租戶 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳: GetTenant200Response

範例

get_tenant 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_tenant(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_tenant: #{e}"
22end
23

取得租戶列表 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query Yes
meta string query No
skip number query No

回應

回傳: GetTenants200Response

範例

get_tenants 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # config.api_key_prefix['x-api-key'] = 'Bearer'
9end
10
11api_instance = FastCommentsClient::DefaultApi.new
12tenant_id = 'tenant_id_example' # String |
13opts = {
14 meta: 'meta_example', # String |
15 skip: 1.2 # Float |
16}
17
18begin
19
20 result = api_instance.get_tenants(tenant_id, opts)
21 p result
22rescue FastCommentsClient::ApiError => e
23 puts "Error when calling DefaultApi->get_tenants: #{e}"
24end
25

更新租戶 Internal Link

參數

Name Type Location Required Description
tenantId string query Yes
id string path Yes

回應

回傳: FlagCommentPublic200Response

範例

update_tenant 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_tenant_body = FastCommentsClient::UpdateTenantBody.new # UpdateTenantBody |
16
17begin
18
19 result = api_instance.update_tenant(tenant_id, id, update_tenant_body)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_tenant: #{e}"
23end
24

上傳圖片 Internal Link


上傳並調整圖片大小

參數

Name Type Location Required Description
tenantId string path
sizePreset string query 大小預設: "Default" (1000x1000px) 或 "CrossPlatform" (為熱門裝置建立尺寸)
urlId string query 上傳所屬的頁面 ID,用於設定

回應

回傳:UploadImageResponse

範例

upload_image 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7file = File.new('/path/to/some/file') # File |
8opts = {
9 size_preset: FastCommentsClient::SizePreset::DEFAULT, # SizePreset | 大小預設: \"Default\" (1000x1000px) 或 \"CrossPlatform\" (為熱門裝置建立尺寸)
10 url_id: 'url_id_example' # String | 上傳所屬的頁面 ID,用於設定
11}
12
13begin
14
15 result = api_instance.upload_image(tenant_id, file, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->upload_image: #{e}"
19end
20

以 ID 取得使用者徽章進度 Internal Link


參數

名稱 類型 位置 必填 描述
tenantId string 查詢參數
id string 路徑參數

回應

回傳: GetUserBadgeProgressById200Response

範例

get_user_badge_progress_by_id 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14id = 'id_example' # 字串 |
15
16begin
17
18 result = api_instance.get_user_badge_progress_by_id(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_user_badge_progress_by_id: #{e}"
22end
23

以使用者 ID 取得徽章進度 Internal Link

參數

名稱 類型 Location 必填 說明
tenantId string query
userId string path

回應

回傳: GetUserBadgeProgressById200Response

範例

get_user_badge_progress_by_user_id 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14user_id = 'user_id_example' # String |
15
16begin
17
18 result = api_instance.get_user_badge_progress_by_user_id(tenant_id, user_id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_user_badge_progress_by_user_id: #{e}"
22end
23

取得使用者徽章進度列表 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query Yes
userId string query No
limit number query No
skip number query No

回應

回傳: GetUserBadgeProgressList200Response

範例

get_user_badge_progress_list 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer'),取消註解下列行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14opts = {
15 user_id: 'user_id_example', # String |
16 limit: 1.2, # Float |
17 skip: 1.2 # Float |
18}
19
20begin
21
22 result = api_instance.get_user_badge_progress_list(tenant_id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->get_user_badge_progress_list: #{e}"
26end
27

建立使用者徽章 Internal Link

參數

名稱 型別 位置 必填 說明
tenantId string query

回應

回傳: CreateUserBadge200Response

範例

create_user_badge 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設定前綴(例如 'Bearer'),請取消註解下列行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14create_user_badge_params = FastCommentsClient::CreateUserBadgeParams.new({user_id: 'user_id_example', badge_id: 'badge_id_example'}) # CreateUserBadgeParams |
15
16begin
17
18 result = api_instance.create_user_badge(tenant_id, create_user_badge_params)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->create_user_badge: #{e}"
22end
23

刪除使用者徽章 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳: UpdateUserBadge200Response

範例

delete_user_badge 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下面這行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.delete_user_badge(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->delete_user_badge: #{e}"
22end
23

取得使用者徽章 Internal Link

參數

Name Type Location Required Description
tenantId string query
id string path

回應

回傳: GetUserBadge200Response

範例

get_user_badge 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解以下行以為 API key 設定前綴,例如 'Bearer' (預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_user_badge(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_user_badge: #{e}"
22end
23

取得使用者徽章列表 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
userId string query
badgeId string query
type number query
displayedOnComments boolean query
limit number query
skip number query

回應

回傳: GetUserBadges200Response

範例

get_user_badges 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列程式行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14opts = {
15 user_id: 'user_id_example', # 字串 |
16 badge_id: 'badge_id_example', # 字串 |
17 type: 1.2, # 浮點數 |
18 displayed_on_comments: true, # 布林值 |
19 limit: 1.2, # 浮點數 |
20 skip: 1.2 # 浮點數 |
21}
22
23begin
24
25 result = api_instance.get_user_badges(tenant_id, opts)
26 p result
27rescue FastCommentsClient::ApiError => e
28 puts "Error when calling DefaultApi->get_user_badges: #{e}"
29end
30

更新使用者徽章 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳: UpdateUserBadge200Response

範例

update_user_badge 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以為 API 金鑰設定前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15update_user_badge_params = FastCommentsClient::UpdateUserBadgeParams.new # UpdateUserBadgeParams |
16
17begin
18
19 result = api_instance.update_user_badge(tenant_id, id, update_user_badge_params)
20 p result
21rescue FastCommentsClient::ApiError => e
22 puts "Error when calling DefaultApi->update_user_badge: #{e}"
23end
24

取得使用者通知計數 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
sso string query

回應

回傳: GetUserNotificationCount200Response

範例

get_user_notification_count 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7opts = {
8 sso: 'sso_example' # String |
9}
10
11begin
12
13 result = api_instance.get_user_notification_count(tenant_id, opts)
14 p result
15rescue FastCommentsClient::ApiError => e
16 puts "Error when calling PublicApi->get_user_notification_count: #{e}"
17end
18

取得使用者通知 Internal Link

參數

名稱 類型 位置 必填 說明
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

範例

get_user_notifications 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7opts = {
8 page_size: 56, # 整數 |
9 after_id: 'after_id_example', # 字串 |
10 include_context: true, # 布林值 |
11 after_created_at: 789, # 整數 |
12 unread_only: true, # 布林值 |
13 dm_only: true, # 布林值 |
14 no_dm: true, # 布林值 |
15 include_translations: true, # 布林值 |
16 sso: 'sso_example' # 字串 |
17}
18
19begin
20
21 result = api_instance.get_user_notifications(tenant_id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling PublicApi->get_user_notifications: #{e}"
25end
26

重設使用者通知計數 Internal Link


參數

名稱 類型 位置 必填 描述
tenantId string query
sso string query

回應

回傳: ResetUserNotifications200Response

範例

reset_user_notification_count 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # String |
7opts = {
8 sso: 'sso_example' # String |
9}
10
11begin
12
13 result = api_instance.reset_user_notification_count(tenant_id, opts)
14 p result
15rescue FastCommentsClient::ApiError => e
16 puts "Error when calling PublicApi->reset_user_notification_count: #{e}"
17end
18

重設使用者通知 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
afterId string query
afterCreatedAt integer query
unreadOnly boolean query
dmOnly boolean query
noDm boolean query
sso string query

回應

回傳: ResetUserNotifications200Response

範例

reset_user_notifications 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7opts = {
8 after_id: 'after_id_example', # 字串 |
9 after_created_at: 789, # 整數 |
10 unread_only: true, # 布林值 |
11 dm_only: true, # 布林值 |
12 no_dm: true, # 布林值 |
13 sso: 'sso_example' # 字串 |
14}
15
16begin
17
18 result = api_instance.reset_user_notifications(tenant_id, opts)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling PublicApi->reset_user_notifications: #{e}"
22end
23

更新使用者評論通知訂閱狀態 Internal Link

啟用或停用特定留言的通知。

參數

名稱 類型 位置 必填 描述
tenantId string query
notificationId string path
optedInOrOut string path
commentId string query
sso string query

回應

回傳:UpdateUserNotificationStatus200Response

範例

update_user_notification_comment_subscription_status 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7notification_id = 'notification_id_example' # 字串 |
8opted_in_or_out = 'in' # 字串 |
9comment_id = 'comment_id_example' # 字串 |
10opts = {
11 sso: 'sso_example' # 字串 |
12}
13
14begin
15
16 result = api_instance.update_user_notification_comment_subscription_status(tenant_id, notification_id, opted_in_or_out, comment_id, opts)
17 p result
18rescue FastCommentsClient::ApiError => e
19 puts "Error when calling PublicApi->update_user_notification_comment_subscription_status: #{e}"
20end
21

更新使用者頁面通知訂閱狀態 Internal Link

啟用或停用頁面通知。當使用者訂閱某頁面時,系統會為新的頂層留言建立通知,並且還會

Parameters

Name Type Location Required Description
tenantId string query Yes
urlId string query Yes
url string query Yes
pageTitle string query Yes
subscribedOrUnsubscribed string path Yes
sso string query No

Response

回傳: UpdateUserNotificationStatus200Response

Example

update_user_notification_page_subscription_status 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7url_id = 'url_id_example' # 字串 |
8url = 'url_example' # 字串 |
9page_title = 'page_title_example' # 字串 |
10subscribed_or_unsubscribed = 'subscribe' # 字串 |
11opts = {
12 sso: 'sso_example' # 字串 |
13}
14
15begin
16
17 result = api_instance.update_user_notification_page_subscription_status(tenant_id, url_id, url, page_title, subscribed_or_unsubscribed, opts)
18 p result
19rescue FastCommentsClient::ApiError => e
20 puts "Error when calling PublicApi->update_user_notification_page_subscription_status: #{e}"
21end
22

更新使用者通知狀態 Internal Link

參數

Name Type Location Required Description
tenantId string query
notificationId string path
newStatus string path
sso string query

回應

回傳: UpdateUserNotificationStatus200Response

範例

update_user_notification_status 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7notification_id = 'notification_id_example' # 字串 |
8new_status = 'read' # 字串 |
9opts = {
10 sso: 'sso_example' # 字串 |
11}
12
13begin
14
15 result = api_instance.update_user_notification_status(tenant_id, notification_id, new_status, opts)
16 p result
17rescue FastCommentsClient::ApiError => e
18 puts "Error when calling PublicApi->update_user_notification_status: #{e}"
19end
20

取得使用者在線狀態 Internal Link


參數

名稱 類型 位置 必填 描述
tenantId string query
urlIdWS string query
userIds string query

回應

回傳:GetUserPresenceStatuses200Response

範例

get_user_presence_statuses 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7url_id_ws = 'url_id_ws_example' # 字串 |
8user_ids = 'user_ids_example' # 字串 |
9
10begin
11
12 result = api_instance.get_user_presence_statuses(tenant_id, url_id_ws, user_ids)
13 p result
14rescue FastCommentsClient::ApiError => e
15 puts "Error when calling PublicApi->get_user_presence_statuses: #{e}"
16end
17

搜尋使用者 Internal Link

參數

Name Type Location Required Description
tenantId string path
urlId string query
usernameStartsWith string query
mentionGroupIds array query
sso string query

回傳

回傳: SearchUsers200Response

範例

search_users 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4
5api_instance = FastCommentsClient::PublicApi.new
6tenant_id = 'tenant_id_example' # 字串 |
7url_id = 'url_id_example' # 字串 |
8username_starts_with = 'username_starts_with_example' # 字串 |
9opts = {
10 mention_group_ids: ['inner_example'], # 陣列<String> |
11 sso: 'sso_example' # 字串 |
12}
13
14begin
15
16 result = api_instance.search_users(tenant_id, url_id, username_starts_with, opts)
17 p result
18rescue FastCommentsClient::ApiError => e
19 puts "Error when calling PublicApi->search_users: #{e}"
20end
21

取得使用者 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path

回應

回傳:GetUser200Response

範例

get_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15
16begin
17
18 result = api_instance.get_user(tenant_id, id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_user: #{e}"
22end
23

建立投票 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query
commentId string query
direction string query
userId string query
anonUserId string query

回應

回傳: VoteComment200Response

範例

create_vote 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API key 授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 如要為 API key 設定前綴(例如 'Bearer',預設為 nil),請取消註解下列一行
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # 字串 |
14comment_id = 'comment_id_example' # 字串 |
15direction = 'up' # 字串 |
16opts = {
17 user_id: 'user_id_example', # 字串 |
18 anon_user_id: 'anon_user_id_example' # 字串 |
19}
20
21begin
22
23 result = api_instance.create_vote(tenant_id, comment_id, direction, opts)
24 p result
25rescue FastCommentsClient::ApiError => e
26 puts "Error when calling DefaultApi->create_vote: #{e}"
27end
28

刪除投票 Internal Link

參數

名稱 類型 位置 必填 說明
tenantId string query
id string path
editKey string query

回應

回傳: DeleteCommentVote200Response

範例

delete_vote 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權: api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 取消註解下列行以設定 API 金鑰的前綴,例如 'Bearer'(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14id = 'id_example' # String |
15opts = {
16 edit_key: 'edit_key_example' # String |
17}
18
19begin
20
21 result = api_instance.delete_vote(tenant_id, id, opts)
22 p result
23rescue FastCommentsClient::ApiError => e
24 puts "Error when calling DefaultApi->delete_vote: #{e}"
25end
26

取得投票列表 Internal Link

參數

名稱 類型 位置 必填 描述
tenantId string query Yes
urlId string query Yes

回應

回傳: GetVotes200Response

範例

get_votes 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14url_id = 'url_id_example' # String |
15
16begin
17
18 result = api_instance.get_votes(tenant_id, url_id)
19 p result
20rescue FastCommentsClient::ApiError => e
21 puts "Error when calling DefaultApi->get_votes: #{e}"
22end
23

取得使用者的投票 Internal Link

參數

名稱 Type 位置 必要 說明
tenantId string query Yes
urlId string query Yes
userId string query No
anonUserId string query No

回應

回傳: GetVotesForUser200Response

範例

get_votes_for_user 範例
Copy Copy
1
2require 'time'
3require 'fastcomments-client'
4# 設定授權
5FastCommentsClient.configure do |config|
6 # 設定 API 金鑰授權:api_key
7 config.api_key['x-api-key'] = 'YOUR API KEY'
8 # 若要為 API 金鑰設置前綴(例如 'Bearer'),請取消註解下面這行(預設為 nil)
9 # config.api_key_prefix['x-api-key'] = 'Bearer'
10end
11
12api_instance = FastCommentsClient::DefaultApi.new
13tenant_id = 'tenant_id_example' # String |
14url_id = 'url_id_example' # String |
15opts = {
16 user_id: 'user_id_example', # String |
17 anon_user_id: 'anon_user_id_example' # String |
18}
19
20begin
21
22 result = api_instance.get_votes_for_user(tenant_id, url_id, opts)
23 p result
24rescue FastCommentsClient::ApiError => e
25 puts "Error when calling DefaultApi->get_votes_for_user: #{e}"
26end
27

需要幫助?

如果您在使用 Ruby SDK 遇到任何問題或有任何疑問,請:

貢獻

歡迎您提交貢獻!請造訪 GitHub 儲存庫 以查看貢獻指南。