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

Articles Details

ユーザーがアクセスできるすべての記事項目を取得します。このリソースは、REST API バージョン 38.0 以降は記事 ID で利用でき、バージョン 44.0 以降は記事の URL 名で利用できます。

Salesforce ナレッジが組織で有効になっている必要があります。このリソースは API バージョン 38.0 以降で使用できます。カスタムファイル項目は、バイナリストリームへのリンクを返すため、サポートされていません。「Salesforce がサポートする言語は?」で使用されている言語コード形式を使用してください。

ルックアップカスタム項目は、ルックアップエンティティ種別に応じてゲストユーザーに表示されます。たとえば、ユーザーは表示されますが、ケースと取引先は表示されません。次の標準項目は、レイアウトに含まれている場合でもゲストユーザーには表示されません。
  • archivedBy
  • isLatestVersion
  • translationCompletedDate
  • translationImportedDate
  • translationExportedDate
  • versionNumber
  • visibleInInternalApp
  • visibleInPKB
  • visibleToCustomer
  • visbileToPartner

有効な channel

  • string channel オプションを使用して、一致する記事が表示される場合、次の値が有効です。
    • App – 内部 Salesforce ナレッジアプリケーションで参照可能
    • Pkb – 公開知識ベースで参照可能
    • Csp – カスタマーポータルで参照可能
    • Prm – パートナーポータルで参照可能
  • channel が指定されていない場合、ユーザーの種別によってデフォルト値が決まります。
    • ゲストユーザーの Pkb
    • カスタマーポータルユーザーの Csp
    • パートナーポータルユーザーの Prm
    • 他の種別のユーザーの App
  • channel が指定されている場合、指定された値を使用して記事を取得できます。
    • ゲストユーザー、カスタマーポータルユーザー、パートナーポータルユーザーの場合、指定されたチャネルがユーザーがアクセスできるチャネルと異なる場合はエラーが返されます。
    • ゲストユーザー、カスタマーポータルユーザー、パートナーポータルユーザー以外のすべてのユーザーの場合は、指定されたチャネル値が使用されます。

構文

メソッド
GET
形式
JSON、XML
認証
Authorization: Bearer token
エンドポイント
/services/data/vXX.X/support/knowledgeArticles/articleId_or_articleUrlName
HTTP ヘッダー
Accept: 省略可能。application/json または application/xml のいずれかです。
Accept-language: 必須。記事は、ユーザーの組織で有効になっている言語で記述されている必要があります。
  • 言語コードが有効でない場合、「言���コードが有効でないか、ナレッジでサポートされていません。」というエラーメッセージが返されます。
  • 言語コードが有効であるが、ナレッジでサポートされていない場合、「無効な言語コードです。言語がナレッジ言語設定に含まれていることを確認してください。」というエラーメッセージが返されます。
入力:
string channel: 省略可能。デフォルトはユーザーのコンテキストです。チャネル値の詳細は、「有効な channel 値」を参照してください。
  • App: 内部 Salesforce ナレッジアプリケーションで参照可能
  • Pkb: 公開知識ベースで参照可能
  • Csp: カスタマーポータルで参照可能
  • Prm: パートナーポータルで参照可能

boolean updateViewStat: 省略可能。デフォルトは true です。true の場合、API は、合計参照数だけでなく指定されたチャネルの参照数も更新します。

boolean isUrlName: 省略可能。デフォルトは false です。true の場合、エンドポイントの最後の部分が記事 ID ではなく URL 名であることを示します。API v44.0 以降で使用できます。
出力:
記事がオンラインで現在のユーザーに対して表示可能な場合の記事の詳細項目。
  • Article Detail

    記事の完全な詳細。記事の表示に使用される完全なメタデータおよびレイアウト主導項目が含まれます。Article Summary 表現と同じプロパティがすべて含まれます。

    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,
    9         "versionNumber": Int,
    10         "createdDate": Date,  // in ISO8601 format
    11         "createdBy": User Summary,
    12         "lastModifiedDate": Date,   // in ISO8601 format
    13         "lastModifiedBy": User Summary,
    14         "lastPublishedDate": Date, // in ISO8601 format
    15         "layoutItems": [ Article Field, ... ],  // standard and custom fields visible to the user, sorted based on the layouts of the article type.
    16         "categories": [ Data Category Groups, ... ], 
    17         "appUpVoteCount": Int,
    18         "cspUpVoteCount": Int,
    19         "prmUpVoteCount": Int,
    20         "pkbUpVoteCount": Int,
    21         "appDownVoteCount": Int,
    22         "cspDownVoteCount": Int,
    23         "prmDownVoteCount": Int,
    24         "pkbDownVoteCount": Int,
    25         "allViewCount": Int,
    26         "appViewCount": Int,
    27         "cspViewCount": Int,
    28         "prmViewCount": Int,
    29         "pkbViewCount": Int,
    30         "allViewScore": Double,
    31         "appViewScore": Double,
    32         "cspViewScore": Double,
    33         "prmViewScore": Double,
    34         "pkbViewScore": Double
    35         }
  • User Summary
    1{
    2         "id": String
    3         "isActive": boolean   // true/false
    4         "userName": String   // login name
    5         "firstName": String
    6         "lastName": String
    7         "email": String
    8         "url": String              // to the chatter user detail url: /services/data/vXX.X/chatter/users/{userId}, for guest user, it will return null.
    9         }
  • Article Field

    記事情報の個別の項目。Article Detail 内にシステム管理者のレイアウトで必要な順序で表示されます。

    1{
    2         "type":  Enum,         // see the Notes
    3         "name": String,        // In API v43.0 and earlier, the developer name. In API v44.0 and later, the API name.
    4         "label": String,         // label
    5         "value": String,  
    6         }

リクエストの例
1curl https://MyDomainName.my.salesforce.com/services/data/v60.0/support/knowledgeArticles/kA0xx000000000LCAQ
2       HTTP Headers:  
3       Content-Type: application/json; charset=UTF-8
4       Accept: application/json
5       Accept-Language: en-US
レスポンスボディの例
1{
2       "allViewCount" : 17,
3       "allViewScore" : 100.0,
4       "appDownVoteCount" : 0,
5       "appUpVoteCount" : 0,
6       "appViewCount" : 17,
7       "appViewScore" : 100.0,
8       "articleNumber" : "000001004",
9       "categoryGroups" : [ ],
10       "createdBy" : {
11       "email" : "user@company.com",
12       "firstName" : "Test",
13       "id" : "005xx000001SvoMAAS",
14       "isActive" : true,
15       "lastName" : "User",
16       "url" : "/services/data/v60.0/chatter/users/005xx000001SvoMAAS",
17       "userName" : "admin@salesforce.org"
18       },
19       "createdDate" : "2016-06-21T21:10:54Z",
20       "cspDownVoteCount" : 0,
21       "cspUpVoteCount" : 0,
22       "cspViewCount" : 0,
23       "cspViewScore" : 0.0,
24       "id" : "kA0xx000000000LCAQ",
25       "lastModifiedBy" : {
26       "email" : "user@company.com",
27       "firstName" : "Test",
28       "id" : "005xx000001SvoMAAS",
29       "isActive" : true,
30       "lastName" : "User",
31       "url" : "/services/data/v60.0/chatter/users/005xx000001SvoMAAS",
32       "userName" : "admin@salesforce.org"
33       },
34       "lastModifiedDate" : "2016-06-21T21:11:02Z",
35       "lastPublishedDate" : "2016-06-21T21:11:02Z",
36       "layoutItems" : [ {
37       "label" : "Out of Date",
38       "name" : "IsOutOfDate",
39       "type" : "CHECKBOX",
40       "value" : "false"
41       }, {
42       "label" : "sample",
43       "name" : "sample",
44       "type" : "PICK_LIST",
45       "value" : null
46       }, {
47       "label" : "Language",
48       "name" : "Language",
49       "type" : "PICK_LIST",
50       "value" : "en_US"
51       }, {
52       "label" : "MyNumber",
53       "name" : "MyNumber",
54       "type" : "NUMBER",
55       "value" : null
56       }, {
57       "label" : "My File",
58       "name" : "My_File",
59       "type" : "FILE",
60       "value" : null
61       } ],
62       "pkbDownVoteCount" : 0,
63       "pkbUpVoteCount" : 0,
64       "pkbViewCount" : 0,
65       "pkbViewScore" : 0.0,
66       "prmDownVoteCount" : 0,
67       "prmUpVoteCount" : 0,
68       "prmViewCount" : 0,
69       "prmViewScore" : 0.0,
70       "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",
71       "title" : "Test Images",
72       "url" : "/services/data/v60.0/support/knowledgeArticles/kA0xx000000000LCAQ",
73       "versionNumber" : 7
74       }

使用方法