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

チャット REST API のレスポンスボディ

チャット REST API リソースへの要求では、応答コードが返されます。リソース要求の実行が成功すると、JSON 形式でレスポンスボディが返される場合もあります。

従来のチャット製品はメンテナンス専用モードになり、新機能の作成を継続することはできません。引き続き使用可能ですが、新しいチャットチャンネルを実装することは推奨しておりません。代わりにアプリ内および Web のメッセージングにより顧客とのコミュニケーションを最新化できます。メッセージングによって、人気の高い多数のチャット機能に加えて、いつでも再開可能な非同期の会話が利用可能になります。

メモ

Availability

応答プロパティ
プロパティ名 説明 使用可能なバージョン
results Result オブジェクトの配列 エージェントやチャットボタンに対応する Salesforce ID と、新しいチャット要求を受信できるかどうかのリスト。 29.0
レスポンスボディ
1{
2"results":{
3            "type":"array",
4            "description":"List of valid patterns of IDs and their availability.",
5            "items":{
6               "name":"result",
7               "type":"object",
8               "properties":{
9                   "id":{
10                       "type":"string",
11                       "description":"ID of the entity.",
12                       "required":true,
13                       "version":29.0
14                   },
15                   "isAvailable":{
16                       "type":"boolean",
17                       "description":"Whether or not the entity is available for chat.",
18                       "version":29.0
19                   }
20               }
21            },
22            "required":true,
23            "version":29.0
24        }
25}

ChasitorSessionData

応答プロパティ
プロパティ名 説明 使用可能なバージョン
queuePosition integer チャットキュー内のチャット訪問者の位置。 29.0
geoLocation GeoLocation オブジェクト 要求が開始された IP アドレスに基づく、チャット訪問者の場所。 29.0
url String チャット訪問者がアクセスしている URL。 29.0
oref String チャット要求の開始元の URL。 29.0
postChatUrl String チャットの終了後にチャット訪問者がリダイレクトされる URL。 29.0
sneakPeekEnabled Boolean チャットを受け入れたエージェントのプレビューが有効になっているかどうか。 29.0
chatMessages TranscriptEntry オブジェクトの配列 agent.js ファイルと chasitor.js ファイルで同期するチャットメッセージの構造。 29.0
レスポンスボディ
1{
2        queuePosition: 1,
3        geoLocation: {
4                countryCode: "US",
5                countryName: "United States of America",
6                region: "CA",
7                city: "San Francisco",
8                organization: Salesforce,
9                latitude: 37.793880,
10                longitude: -122.395114
11        },
12        url: "http://yoursite",
13        oref: "http://www.google.com?q=yoursite",
14        postChatUrl: "http://yoursite/postchat",
15        sneakPeekEnabled: true,
16        chatMessages: [
17                {
18                        type: "Agent",
19                        name: "Andy L.",
20                        content: "Hello, how can I help you?",
21                        timestamp: 1376596367548,
22                        sequence: 1
23                },
24                {
25                        type: "Chasitor",
26                        name: "Jon A.",
27                        content: "I have a question for you.",
28                        timestamp: 1376596349132
29                        sequence: 2
30                }
31        ]
32}

ChasitorIdleTimeoutWarningEvent

応答プロパティ
プロパティ名 説明 使用可能なバージョン
idleTimeoutWarningEvent String 警告のトリガー時またはクリア時にサーバーに通知します。可能な値は、triggeredcleared です。 35.0

ChatEndReason

応答プロパティ
プロパティ名 説明 使用可能なバージョン
reason String チャットを終了した理由。 29.0
attachedRecords String

チャットのトランスクリプトオブジェクトに対応付けられたレコード ID と、その対応付けを含むトランスクリプト項目名のリストを返します。この対応付けのデータは、チャット後の実装を強化するのに役立ちます。

チャットボタンでチャット後機能が有効になっている場合に利用できます。クライアントが attachedRecords チャット後機能を使用し、訪問者がクライアントで ChatEnded 応答を受信しないままチャットを終了した場合、ChatEnd を呼び出した後にメッセージを再度呼び出します。

29.0

ChatEstablished

応答プロパティ
プロパティ名 説明 使用可能なバージョン
name String チャットに参加しているエージェントの名前。 29.0
userId String チャットに参加しているエージェントのユーザー ID。 29.0
sneakPeekEnabled Boolean チャットを受け入れたエージェントのプレビューが有効になっているかどうか。 29.0
chasitorIdletimeout ChasitorIdleTimeoutSettings 訪問者のアイドルタイムアウトの設定。 35.0
レスポンスボディ
1{
2        name: "Andy L.",
3        userId: "f1dda237-57f8-4816-b8e8-59775f1e44c8",
4        sneakPeekEnabled: true
5}

ChatMessage

応答プロパティ
プロパティ名 説明 使用可能なバージョン
name String チャットに参加しているエージェントの名前。 29.0
text String エージェントがチャット訪問者に送信したチャットメッセージのテキスト。 29.0
レスポンスボディ
1{
2        name: "Andy L."
3        text: "Hello, how can I help you?"
4}

ChatRequestFail

応答プロパティ
プロパティ名 説明 使用可能なバージョン
reason String チャット要求が失敗した理由 (どのエージェントもチャットすることができなかった、内部エラーが発生したなど)。 29.0
postChatUrl String チャットの終了後にチャット訪問者がリダイレクトされる事後チャットページの URL。 29.0
レスポンスボディ
1{
2        reason: "Unavailable",
3        postChatUrl: "http://yoursite/postChat"
4}

ChatRequestSuccess

応答プロパティ
プロパティ名 説明 使用可能なバージョン
queuePosition integer チャットキュー内のチャット訪問者の位置。 29.0
estimatedWaitTime number ボタンの予想待ち時間 (単位: 秒)。サーバーが待ち時間を取得できない場合、このプロパティは -1 を返します。 47.0
geoLocation GeoLocation オブジェクト 要求が開始された IP アドレスに基づく、チャット訪問者の場所。 29.0
url String チャット訪問者がアクセスしている URL。 29.0
oref String チャット要求の開始元の URL。 29.0
postChatUrl String チャットの終了後にチャット訪問者がリダイレクトされる URL。 29.0
customDetails CustomDetail オブジェクトの配列 チャット要求が開始されたリリースのカスタム詳��。 29.0
visitorId String チャット訪問者の ID。 29.0
レスポンスボディ
1"{
2        queuePosition: 1,
3        estimatedWaitTime: 120,
4        geoLocation: {
5                countryCode:"US",
6                countryName: "United States of America",
7                region: "CA",
8                city: "San Francisco",
9                organization: Salesforce,
10                latitude: 37.793880,
11                longitude: -122.395114
12        },
13        url: "http://yoursite",
14        oref: "http://www.google.com?q=yoursite",
15        postChatUrl: "http://yoursite/postchat",
16        customDetails: [
17                {
18                        label: "E-mail Address",
19                        value: "jon@example.com",
20                        transcriptFields: [
21                                 "c__EmailAddress"
22                         ],
23                        displayToAgent: true
24                }                        
25
26        ],
27        visitorId: "acd47048-bd80-476e-aa33-741bd5cb05d3"
28}"

ChatTransferred

応答プロパティ
プロパティ名 説明 使用可能なバージョン
name String チャットの転送先のエージェントの名前。 29.0
userId String チャット訪問者の ID。 29.0
sneakPeekEnabled Boolean チャットの転送先のエージェントのプレビューが有効になっているかどうか。 29.0
chasitorIdletimeout ChasitorIdleTimeoutSettings 訪問者のアイドルタイムアウトの設定。 35.0
レスポンスボディ
1{
2        name: "Ryan S.",
3        userId: "edacfa56-b203-43d5-9e1b-678278b61263",
4        sneakPeekEnabled: false
5}

CustomEvent

応答プロパティ
プロパティ名 説明 使用可能なバージョン
type String 発生したカスタムイベントのタイプ。チャット訪問者側のイベントリスナーを追加するために使用されます。 29.0
data String チャット訪問者に送信されたイベントに関連するデータ。 29.0
レスポンスボディ
1{
2        type: "CreditCardEntered",
3        data: "5105105105105100"
4}

Messages

応答プロパティ
プロパティ名 説明 使用可能なバージョン
messages Message オブジェクトの配列 チャット中に送信されたメッセージ。 29.0
offset integer クライアントが受信したメッセージを追跡する ReconnectSession 要求で使用される内部番号。 29.0
sequence integer チャット中に受信したメッセージの順序。 29.0
レスポンスボディ
1{
2        messages: [
3                {
4                        type: "ChatEstablished",
5                        message: {
6                                name: "Andy L.",
7                                userId: "f1dda237-57f8-4816-b8e8-59775f1e44c8",
8                                sneakPeekEnabled: true
9                        }
10                }
11        ],
12        sequence: 1,
13        offset: 1234567890
14}

NewVisitorBreadcrumb

応答プロパティ
プロパティ名 説明 使用可能なバージョン
location String チャット訪問者が表示している Web ページの URL。 29.0
レスポンスボディ
1{
2        location: "http://yoursite/page2"
3}

QueueUpdate

応答プロパティ
プロパティ名 説明 使用可能なバージョン
position integer チャットキュー内のチャット訪問者の更新された位置。 29.0
estimatedWaitTime number ボタンの予想待ち時間 (単位: 秒)。サーバーが待ち時間を取得できない場合、このプロパティは -1 を返します。 47.0
レスポンスボディ
1{
2        position: 3,
3        estimatedWaitTime: 120
4}

ReconnectSession

応答プロパティ
プロパティ名 説明 使用可能なバージョン
resetSequence Boolean true の場合、次の要求のシーケンスはリセットする必要があります。 37.0
affinityToken String 今後のすべての要求のヘッダーで渡される、セッションのアフィニティトークン。 37.0
レスポンスボディ
1{
2        resetSequence: true,
3        affinityToken: "73061fa0"
4}

SessionId

応答プロパティ
プロパティ名 説明 使用可能なバージョン
id String 新しいセッションのセッション ID。 29.0
key String 新しいセッションのセッションキー。 29.0
affinityToken String 今後のすべての要求のヘッダーで渡される、セッションのアフィニティトークン。 29.0
clientPollTimeout integer Messages 要求の実行期限 (秒数)。この期限内に実行しないと、Messages long polling ループがタイムアウトして終了します。 29.0
レスポンスボディ
1{
2        id: "241590f5-2e59-44b5-af89-9cae83bb6947",
3        key: 
4        "f6c1d699-84c7-473f-b194-abf4bf7cccf8!b65b13c7-f597-4dd2-aa3a-cbe01e69f19c",
5        affinityToken: "73061fa0"
6        clientPollTimeout: "30"
7}

Settings

応答プロパティ
プロパティ名 説明 使用可能なバージョン
pingrate number チャット訪問者セッションを維持するために訪問者がサーバーに ping する必要のある頻度。 29.0
contentServerUrl String コンテンツサーバーの URL。 29.0
buttons button オブジェクトの配列 Settings 要求の実行時に指定した、チャットボタンとその設定情報のリスト。 29.0
レスポンスボディ
1{
2        "pingRate":{
3            "type":"number",
4            "description":"The rate at which the visitor should ping the server to maintain presence",
5            "required":true,
6            "version":29.0
7        },
8        "contentServerUrl":{
9            "type":"string",
10            "description":"The content server URL",
11            "required":true,
12            "version":29.0
13        },
14        "buttons":{
15            "type":"array",
16            "description":"The list of buttons",
17            "items":{
18               "name":"button",
19               "type":"object",
20               "properties":{
21                   "id":{
22                       "type":"string",
23                       "description":"The id of the button",
24                       "required":true,
25                       "version":29.0
26                   },
27                   "type":{
28                       "type":"string",
29                       "description":"The type of the button",
30                       "required":true,
31                       "version":29.0,
32                       "enum":["Standard","Invite","ToAgent"]
33                   },
34                   "endpointUrl":{
35                       "type":"string",
36                       "description":"The custom chat window url of the button",
37                       "required":false,
38                       "version":29.0
39                   },
40                   "prechatUrl":{
41                       "type":"string",
42                       "description":"The prechat url of the button",
43                       "required":false,
44                       "version":29.0
45                   },
46                   "language":{
47                       "type":"string",
48                       "description":"The language setting of the button",
49                       "required":false,
50                       "version":29.0
51                   },
52                   "isAvailable":{
53                       "type":"boolean",
54                       "description":"Whether or not the button is available for chat",
55                       "version":29.0
56                   },
57                   /* Invite related settings */
58                   "inviteImageUrl":{
59                       "type":"string",
60                       "description":"The image of the button",
61                       "required":false,
62                       "version":29.0
63                   },
64                   "inviteImageWidth":{
65                       "type":"number",
66                       "description":"The width of the button image",
67                       "required":false,
68                       "version":29.0
69                   },
70                   "inviteImageHeight":{
71                       "type":"number",
72                       "description":"The height of the button image",
73                       "required":false,
74                       "version":29.0
75                   },
76                   "inviteRenderer":{
77                       "type":"string",
78                       "description":"The animation option of the invite",
79                       "required":false,
80                       "version":29.0,
81                       "enum":["Slide","Fade","Appear","Custom"]
82                   },
83                   "inviteStartPosition":{
84                       "type":"string",
85                       "description":"The start position of the animation",
86                       "required":false,
87                       "version":29.0,
88                       "enum":["TopLeft","TopLeftTop","Top","TopRightTop","TopRight",
89                               "TopRightRight","Right","BottomRightRight","BottomRight",
90                               "BottomRightBottom","Bottom","BottomLeftBottom","BottomLeft",
91                               "BottomLeftLeft","Left","TopLeftLeft"]
92                   },
93                   "inviteEndPosition":{
94                       "type":"string",
95                       "description":"The end position of the animation",
96                       "required":false,
97                       "version":29.0,
98                       "enum":["TopLeft","Top","TopRight","Left","Center","Right","BottomLeft","Bottom","BottomRight"]
99                   },
100                   "hasInviteAfterAccept":{
101                       "type":"boolean",
102                       "description":"Whether or not invite will trigger after accepting",
103                       "required":false,
104                       "version":29.0
105                   },
106                   "hasInviteAfterReject":{
107                       "type":"boolean",
108                       "description":"Whether or not invite will trigger after rejecting",
109                       "required":false,
110                       "version":29.0
111                   },
112                   "inviteRejectTime":{
113                       "type":"number",
114                       "description":"The auto reject setting of the invite",
115                       "required":false,
116                       "version":29.0
117                   },
118                   "inviteRules":{
119                       "type":"object",
120                       "description":"The rules of the invite",
121                       "required":false,
122                       "version":29.0
123                   }
124                   /* Invite related settings */
125               }
126            },
127            "required":true,
128            "version":29.0
129        }
130    }

SwitchServer

この応答は、Visitor リソースへの要求に対して、提供された組織 ID の Live Agent インスタンス URL が正しくない場合に返されます。
応答プロパティ
プロパティ名 説明 使用可能なバージョン
newUrl String 組織が移動した場合は、組織の新しいチャット API エンドポイント。計画された組織の移行によって、または異なるインスタンスへのサイト切り替え中に組織が移動する可能性があります。 29.0
レスポンスボディ
1{
2      "messages": [
3            "type": "SwitchServer"
4            "message": {
5                  "newUrl": "https://LiveAgentPool.salesforceliveagent.com/chat"
6            }
7      ]
8}

VisitorId

応答プロパティ
プロパティ名 説明 使用可能なバージョン
sessionId String 新しいセッションのセッション ID。 29.0
レスポンスボディ
1"sessionId":{
2            "type":"string",
3            "description":"The session id of the visitor",
4            "required":true,
5            "version":29.0
6        }