Live Agent REST API のレスポンスボディ
Live Agent REST API リソースへの要求では、応答コードが返されます。リソース要求の実行が成功すると、JSON 形式でレスポンスボディが返される場合もあります。
Availability
- 応答プロパティ
-
プロパティ名 型 説明 使用可能なバージョン results Result オブジェクトの配列 エージェントやチャットボタンに対応する Salesforce ID と、新しいチャット要求を受信できるかどうかのリスト。 29.0 - レスポンスボディ
-
1{ 2"results":{ 3 "type":"array", 4 "description":"List of ids and their availability", 5 "items":{ 6 "name":"result", 7 "type":"object", 8 "properties":{ 9 "id":{ 10 "type":"string", 11 "description":"The 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 "required":true, 19 "version":29.0 20 } 21 } 22 }, 23 "required":true, 24 "version":29.0 25 } 26}
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.com, 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 警告のトリガ時またはクリア時にサーバに通知します。使用できる値は、triggered と cleared です。 35.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 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 geoLocation: { 4 countryCode:"US", 5 countryName: "United States of America", 6 region: "CA", 7 city: "San Francisco", 8 organization: Salesforce.com, 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 customDetails: [ 16 { 17 label: "E-mail Address", 18 value: "jon@example.com", 19 transcriptFields: [ 20 "c__EmailAddress" 21 ], 22 displayToAgent: true 23 } 24 25 ], 26 visitorId: "acd47048-bd80-476e-aa33-741bd5cb05d3" 27}"
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 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}
NewVisitorBreadcrumb
- 応答プロパティ
-
プロパティ名 型 説明 使用可能なバージョン location String チャット訪問者が表示している Web ページの URL。 29.0 - レスポンスボディ
-
1{ 2 location: "http://yoursite/page2" 3}
QueueUpdate
- 応答プロパティ
-
プロパティ名 型 説明 使用可能なバージョン position integer チャットキュー内のチャット訪問者の更新された位置。 29.0 - レスポンスボディ
-
1{ 2 position: 3 3}
ResyncSession
- 応答プロパティ
-
プロパティ名 型 説明 使用可能なバージョン isValid Boolean セッションが有効か (true)、否か (false) を示します。 29.0 key String 古いセッションが再確立された後の新しいセッションのセッションキー。 29.0 affinityToken String 今後のすべての要求のヘッダーで渡される、セッションのアフィニティトークン。 29.0 - レスポンスボディ
-
1{ 2 isValid: true, 3 key: "dd19849c-26df-4e21-b4cf-3aada410f35d", 4 affinityToken: "73061fa0" 5}
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 Live Agent 訪問者セッションを維持するために訪問者がサーバに 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 "required":true, 56 "version":29.0 57 }, 58 /* Invite related settings */ 59 "inviteImageUrl":{ 60 "type":"string", 61 "description":"The image of the button", 62 "required":false, 63 "version":29.0 64 }, 65 "inviteImageWidth":{ 66 "type":"number", 67 "description":"The width of the button image", 68 "required":false, 69 "version":29.0 70 }, 71 "inviteImageHeight":{ 72 "type":"number", 73 "description":"The height of the button image", 74 "required":false, 75 "version":29.0 76 }, 77 "inviteRenderer":{ 78 "type":"string", 79 "description":"The animation option of the invite", 80 "required":false, 81 "version":29.0, 82 "enum":["Slide","Fade","Appear","Custom"] 83 }, 84 "inviteStartPosition":{ 85 "type":"string", 86 "description":"The start position of the animation", 87 "required":false, 88 "version":29.0, 89 "enum":["TopLeft","TopLeftTop","Top","TopRightTop","TopRight", 90 "TopRightRight","Right","BottomRightRight","BottomRight", 91 "BottomRightBottom","Bottom","BottomLeftBottom","BottomLeft", 92 "BottomLeftLeft","Left","TopLeftLeft"] 93 }, 94 "inviteEndPosition":{ 95 "type":"string", 96 "description":"The end position of the animation", 97 "required":false, 98 "version":29.0, 99 "enum":["TopLeft","Top","TopRight","Left","Center","Right","BottomLeft","Bottom","BottomRight"] 100 }, 101 "hasInviteAfterAccept":{ 102 "type":"boolean", 103 "description":"Whether or not invite will trigger after accepting", 104 "required":false, 105 "version":29.0 106 }, 107 "hasInviteAfterReject":{ 108 "type":"boolean", 109 "description":"Whether or not invite will trigger after rejecting", 110 "required":false, 111 "version":29.0 112 }, 113 "inviteRejectTime":{ 114 "type":"number", 115 "description":"The auto reject setting of the invite", 116 "required":false, 117 "version":29.0 118 }, 119 "inviteRules":{ 120 "type":"object", 121 "description":"The rules of the invite", 122 "required":false, 123 "version":29.0 124 } 125 /* Invite related settings */ 126 } 127 }, 128 "required":true, 129 "version":29.0 130 } 131 }
SwitchServer
- この応答は、Visitor リソースへの要求に対して、提供された 組織 ID の Live Agent インスタンス URL が正しくない場合に返されます。
- 応答プロパティ
-
プロパティ名 型 Description 使用可能なバージョン newUrl String 組織が移動した場合は、組織の新しい Live Agent API エンドポイント。計画された組織の移行によって、または異なるインスタンスへのサイト切り替え中に組織が移動する可能性があります。 29.0 - レスポンスボディ
-
1{ 2 "messages": [ 3 "type": "SwitchServer" 4 "message": { 5 "newUrl": "https://YOUR-INSTANCE.salesforceliveagent.com/chat" 6 } 7 ] 8}