この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Knowledge クラス

Experience Cloud サイトのトレンド記事に関する情報を取得します。

名前空間

ConnectApi

Knowledge のメソッド

Knowledge のメソッドは次のとおりです。すべてのメソッドが静的です。

getTopViewedArticlesForTopic(communityId, topicId, maxResults)

トピックの最多参照記事を取得します。

API バージョン

41.0

ゲストユーザーが使用可能

41.0

Chatter が必要かどうか

いいえ

署名

public static ConnectApi.KnowledgeArticleVersionCollection getTopViewedArticlesForTopic(String communityId, String topicId, Integer maxResults)

パラメーター

communityId
型: String
Experience Cloud サイトの ID、internal、または null
topicId
型: String
トピックの ID。
maxResults
型: Integer
各トピック ID で返される記事の最大数。有効な値は 1 ~ 25 です。デフォルト値は、5 です。

getTrendingArticles(communityId, maxResults)

Experience Cloud サイトのトレンド記事を取得します。

API バージョン

36.0

ゲストユーザーが使用可能

36.0

Chatter が必要かどうか

いいえ

署名

public static ConnectApi.KnowledgeArticleVersionCollection getTrendingArticles(String communityId, Integer maxResults)

パラメーター

communityId
型: String
Experience Cloud サイトの ID、internal、または null
maxResults
型: Integer
返される記事の最大数。有効な値は 0 ~ 25 です。デフォルトは 5 です。

使用方法

このメソッドを使用するコードをテストするには、一致する set test メソッドを使用します (メソッド名に setTest をプレフィックスとして付けます)。set test メソッドでは、同じパラメーターを使用します。パラメーターが同じでないと、コードで例外が発生します。

getTrendingArticlesForTopic(communityId, topicId, maxResults)

Experience Cloud サイトのトピックのトレンド記事を取得します。

API バージョン

36.0

ゲストユーザーが使用可能

36.0

Chatter が必要かどうか

いいえ

署名

public static ConnectApi.KnowledgeArticleVersionCollection getTrendingArticlesForTopic(String communityId, String topicId, Integer maxResults)

パラメーター

communityId
型: String
Experience Cloud サイトの ID、internal、または null
topicId
型: String
トピックの ID。
maxResults
型: Integer
返される記事の最大数。有効な値は 0 ~ 25 です。デフォルトは 5 です。

使用方法

このメソッドを使用するコードをテストするには、一致する set test メソッドを使用します (メソッド名に setTest をプレフィックスとして付けます)。set test メソッドでは、同じパラメーターを使用します。パラメーターが同じでないと、コードで例外が発生します。

Knowledge テストメソッド

Knowledge のテストメソッドを次に示します。すべてのメソッドが静的です。

これらのメソッドを使用して ConnectApi コードをテストする方法の詳細は、「ConnectApi コードのテスト」を参照してください。

setTestGetTrendingArticles(communityId, maxResults, result)

一致する ConnectApi.getTrendingArticles メソッドをテストコンテキストでコールするときに返される ConnectApi.KnowledgeVersionArticleCollection オブジェクトを登録します。メソッドでは、同じパラメーターを使用します。パラメーターが同じでないと、例外が発生します。

API バージョン

36.0

署名

public static Void setTestGetTrendingArticles(String communityId, Integer maxResults, ConnectApi.KnowledgeArticleVersionCollection result)

パラメーター

communityId
型: String
Experience Cloud サイトの ID、internal、または null
maxResults
型: Integer
返される記事の最大数。有効な値は 0 ~ 25 です。デフォルトは 5 です。
result
型: ConnectApi.KnowledgeArticleVersionCollection
テストデータを含むオブジェクト。

戻り値

型: Void

setTestGetTrendingArticlesForTopic(communityId, topicId, maxResults, result)

一致する ConnectApi.getTrendingArticlesForTopic メソッドをテストコンテキストでコールするときに返される ConnectApi.KnowledgeVersionArticleCollection オブジェクトを登録します。メソッドでは、同じパラメーターを使用します。パラメーターが同じでないと、例外が発生します。

API バージョン

36.0

署名

public static Void setTestGetTrendingArticlesForTopic(String communityId, String topicId, Integer maxResults, ConnectApi.KnowledgeArticleVersionCollection result)

パラメーター

communityId
型: String
Experience Cloud サイトの ID、internal、または null
topicId
型: String
トピックの ID。
maxResults
型: Integer
返される記事の最大数。有効な値は 0 ~ 25 です。デフォルトは 5 です。
result
型: ConnectApi.KnowledgeArticleVersionCollection
テストデータを含むオブジェクト。

戻り値

型: Void