Articles List
構文
- 適用開始バージョン
- 38.0
- メソッド
- GET
- 形式
- JSON、XML
- 認証
- Oauth アクセストークン
- エンドポイント
- /services/data/vXX.X/support/knowledgeArticles
- HTTP ヘッダー
-
Accept: 省略可能。application/json または application/xml のいずれかです。Accept-language: 必須。記事は、ユーザの組織で有効になっている言語で記述されている必要があります。
- 言語コードが有効でない場合、「言語コードが有効でないか、ナレッジでサポートされていません。」というエラーメッセージが返されます。
- 言語コードが有効であるが、ナレッジでサポートされていない場合、「無効な言語コードです。言語がナレッジ言語設定に含まれていることを確認してください。」というエラーメッセージが返されます。
- 入力:
-
string q: 省略可能。SOSL 検索を実行します。クエリ文字列が null または空であるか指定されていない場合、SOQL クエリが実行されます。
文字 ? と * はワイルドカード検索に使用されます。文字 (、)、および " は、複雑な検索語に使用されます。https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_find.htm を参照してください。
-
string channel: 省略可能。デフォルトはユーザのコンテキストです。チャネル値の詳細は、「有効な channel 値」を参照してください。
- App: 内部 Salesforce ナレッジアプリケーションで参照可能
- Pkb: 公開知識ベースで参照可能
- Csp: カスタマーポータルで参照可能
- Prm: パートナーポータルで参照可能
-
string categories (json の対応付け形式 {"group1":"category1","group2":"category2",...} ) )
省略可能。デフォルトは None です。カテゴリグループはグループ:カテゴリの各ペア内で一意である必要があります。そうでない場合は、ARGUMENT_OBJECT_PARSE_ERROR が発生します。データカテゴリ条件の数は 3 つまでに制限されています。この数を超えると、INVALID_FILTER_VALUE が発生します。
-
string queryMethod : 値は AT, BELOW, ABOVE, ABOVE_OR_BELOW です。カテゴリが指定されている場合のみ有効です。デフォルトは ABOVE_OR_BELOW です。
-
string sort: 省略可能。並び替え可能な項目名 LastPublishedDate, CreatedDate, Title, ViewScore です。デフォルトは LastPublishedDate で、クエリおよび検索の関連性に使用されます。
-
string order: 省略可能。ASC または DESC。デフォルトは DESC です。sort が有効な場合のみ有効です。
-
integer pageSize: 省略可能。デフォルトは 20 です。有効な範囲は 1 ~ 100 です。
-
integer pageNumber : 省略可能。デフォルトは 1 です。
- 出力:
- 指定された言語およびカテゴリで、現在のユーザが参照可能なオンライン記事のページ。
-
Article Page
記事のページ。個々のエントリは、サイズを最小限に保つために記事の概要になっています。
1{ 2 "articles": [ Article Summary, … ], // list of articles 3 "currentPageUrl": URL, // the article list API with current page number 4 "nextPageUrl": URL, // the article list API with next page number, 5 which can be null if there are no more articles. 6 "pageNumber": Int // the current page number, starting at 1. 7 } -
Article Summary
記事の応答のリストに使用される記事の概要。Article Detail 表現と同様のプロパティがあります。これは、一方がもう一方のスーパーセットであるためです。
1{ 2 "id": Id, // articleId 3 "articleNumber": String, 4 "articleType": String, // apiName of the article type, available in API v44.0 and later 5 "title": String, 6 "urlName": String, // available in API v44.0 and later 7 "summary": String, 8 "url": URL, // to the Article Detail API 9 "viewCount": Int, // view count in the interested channel 10 "viewScore": double (in xxx.xxxx precision), // view score in the interested channel. 11 "upVoteCount": int, // up vote count in the interested channel. 12 "downVoteCount": int, // down vote count in the interested channel. 13 "lastPublishedDate": Date // last publish date in ISO8601 format 14 "categoryGroups": [ Data Category Group, …. ]}「url」プロパティは常に Article Details リソースのエンドポ���ントを指し示します。有効なチャネル値の詳細は、channel パラメータの説明を参照してください。
-
Data Category Group
個別のデータカテゴリグループ、ルートカテゴリ、およびグループ内で選択されたデータカテゴリのリストです。
1{ 2 "groupName": String, // the unique name of the category group 3 "groupLabel": String, // returns the translated version 4 "selectedCategories": [ Data Category Summary, … ] 5 } -
Data Category Summary
データカテゴリ情報の概要を提供します。Summary 応答と Detail 応答のプロパティは共通です。
1{ 2 "categoryName": String, // the unique name of the category 3 "categoryLabel": String, // returns the translated version, per the API language specified 4 "url": String // returns the url for the DataCategory REST API. 5 }
-
Article Page
例
- 入力
-
1/services/data/v57.0/support/knowledgeArticles?sort=ViewScore&channel=Pkb&pageSize=3 2 HTTP Headers: 3 Content-Type: application/json; charset=UTF-8 4 Accept: application/json 5 Accept-Language: en-US - 出力
-
1{ 2 "articles" : [ { 3 "articleNumber" : "000001002", 4 "categoryGroups" : [ ], 5 "downVoteCount" : 0, 6 "id" : "kA0xx000000000BCAQ", 7 "lastPublishedDate" : "2015-02-25T02:07:18Z", 8 "summary" : "With this online Chinese input tool, you can type Chinese characters through your web browser without installing any Chinese input software in your system. The Chinese online input tool uses the popular Pin Yin input method. It is a fast and convenient tool to input Chinese on English OS environments.", 9 "title" : "Long text test", 10 "upVoteCount" : 0, 11 "url" : "/services/data/v57.0/support/knowledgeArticles/kA0xx000000000BCAQ", 12 "viewCount" : 4, 13 "viewScore" : 100.0 14 }, { 15 "articleNumber" : "000001004", 16 "categoryGroups" : [ ], 17 "downVoteCount" : 0, 18 "id" : "kA0xx000000000LCAQ", 19 "lastPublishedDate" : "2016-06-21T21:11:02Z", 20 "summary" : "The number of characters required for complete coverage of all these languages' needs cannot fit in the 256-character code space of 8-bit character encodings, requiring at least a 16-bit fixed width encoding or multi-byte variable-length encodings. \r\n\r\nAlthough CJK encodings have common character sets, the encodings often used to represent them have been developed separately by different East Asian governments and software companies, and are mutually incompatible. Unicode has attempted, with some controversy, to unify the character sets in a process known as Han unification.\r\n\r\nCJK character encodings should consist minimally of Han characters p", 21 "title" : "Test Images", 22 "upVoteCount" : 0, 23 "url" : "/services/data/v57.0/support/knowledgeArticles/kA0xx000000000LCAQ", 24 "viewCount" : 0, 25 "viewScore" : 0.0 26 }, { 27 "articleNumber" : "000001012", 28 "categoryGroups" : [ ], 29 "downVoteCount" : 0, 30 "id" : "kA0xx000000006GCAQ", 31 "lastPublishedDate" : "2016-06-21T21:10:48Z", 32 "summary" : null, 33 "title" : "Test Draft 2", 34 "upVoteCount" : 0, 35 "url" : "/services/data/v57.0/support/knowledgeArticles/kA0xx000000006GCAQ", 36 "viewCount" : 0, 37 "viewScore" : 0.0 38 } ], 39 "currentPageUrl" : "/services/data/v57.0/support/knowledgeArticles?channel=Pkb&pageSize=3&sort=ViewScore", 40 "nextPageUrl" : null, 41 "pageNumber" : 1 42}
使用方法
Salesforce ナレッジが組織で有効になっている必要があります。このリソースは API バージョン 38.0 以降で使用できます。カスタムファイル項目は、バイナリストリームへのリンクを返すため、サポートされていません。「Salesforce がサポートする言語は?」で使用されている言語コード形式を使用してください。
有効な channel 値
- string channel オプションを使用して、一致する記事が表示される場合、次の値が有効です。
- App – 内部 Salesforce ナレッジアプリケーションで参照可能
- Pkb – 公開知識ベースで参照可能
- Csp – カスタマーポータルで参照可能
- Prm – パートナーポータルで参照可能
-
channel が指定されていない場合、ユーザの種別によってデフォルト値が決まります。
- ゲストユーザの Pkb
- カスタマーポータルユーザの Csp
- パートナーポータルユーザの Prm
- 他の種別のユーザの App
-
channel が指定されている場合、指定された値を使用して記事を取得できます。
- ゲストユーザ、カスタマーポータルユーザ、パートナーポータルユーザの場合、指定されたチャネルがユーザがアクセスできるチャネルと異なる場合はエラーが返されます。
- ゲストユーザ、カスタマーポータルユーザ、パートナーポータルユーザ以外のすべてのユーザの場合は、指定されたチャネル値が使用されます。