onInteractionRemoved
このハンドラーは、エージェントのインタラクションが終了した後に呼び出されます。このイベントには、完了したインタラクションに関するすべてのデータが含まれます。Communicator ウィジェット 2.0 にのみ適用されます。
リクエスト
構文
| on('ON_INTERACTION_REMOVED', handler: OnInteractionRemovedHandler): void
type OnInteractionRemovedHandler = (removedInteraction: InteractionData) => void type InteractionData = { interactionId: string state: InteractionState type: InteractionType callParties: CallParty[] chatParties: ChatParty[] callMuted: boolean callRecording: boolean attachedData: AttachedData internal: boolean phoneNumber?: string email?: string callDirection?: CallDirection startTime?: number endTime?: number duration?: number description?: string disposition?: string globalInteractionId?: string service?: string playbackUrl?: string recordingUrl?: string DNIS?: string ANI?: string origination?: InteractionOrigination } type InteractionType = "voice" | "chat" | "email" type InteractionState = "unknown" | "queued" | "ivr" | "wrap_up" | "wrap_up_hold" | "delivered" | "delivery_pending" | "hold" | "completed" type InteractionOrigination = "dialpad" | "dialpad-search" | "directory" | "recent" | "favorites" | "workitem" | "interaction" | "contact-profile" | "help" | "conference" | "auto" | "integration-api" type CallDirection = "inbound" | "outbound" type CallParty = { id: string name: string phone: string userId?: string } type ChatPartyType = "internal" | "external" type ChatParty = { id: string type: ChatPartyType name: string userId?: string contactId?: string email?: string phone?: string } |
パラメータ
| パラメータ | パラメータ値 | データ型 | オプション/必須 | 説明 |
| interaction | ||||
| type | 文字列 | 必須 | インタラクションの種類を示します。認識される種類は以下の通りです:
| |
| interactionId | 文字列 | 必須 | インタラクションの ID | |
| globalInteractionId | 文字列 | オプション | インタラクションのグローバルインタラクション ID (GIID) | |
| service | 文字列 | オプション | そのインタラクションに関連するサービスの名前 | |
| callParties | CallParty[] | 必須 | 通話参加者のリストを提供します。なお、これは type が「voice」であるインタラクションに適用されます。各項目は以下の通りです:
| |
| chatParties | ChatParty[] | 必須 | チャットの参加者のリストを提供します。なお、これは type が「chat」であるインタラクションに適用されます。各項目は以下の通りです:
| |
| callMuted | ブール値 | 必須 | true に設定するとコールはミュートされ、false に設定するとミュートされません。通話以外のインタラクションでは常に false となる点にご注意ください。 | |
| callRecording | ブール値 | 必須 | true に設定すると通話録音機能が有効になり、false に設定すると無効になります。通話以外のインタラクションでは常に false に設定される点にご注意ください。 | |
| disposition | 文字列 | オプション | この渡されたインタラクションのディスポジションカテゴリーの名前 | |
| description | 文字列 | オプション | そのインタラクションについてエージェントが追加したメモ | |
| recordingUrl | 文字列 | オプション | 通話録音の URL です。なお、これは type が「voice」であるインタラクションに適用される点にご注意ください。 | |
| playbackUrl | 文字列 | オプション | 通話録音の再生用 URL です。なお、これは type が「voice」であるインタラクションに適用されます。 | |
| callDirection | 文字列 | オプション | コールの方向です。認識される方向は以下の通りです:
なお、これは type が「voice」であるインタラクションに適用されます。 | |
| internal | ブール値 | 必須 | そのインタラクションが内部のもの(別のエージェントとの間)か、外部の顧客とのものかを示します。 | |
| DNIS | 文字列 | オプション | ダイヤル番号識別サービス (DNIS)。なお、これは type が「voice」であるインタラクションに適用されます。 | |
| ANI | 文字列 | オプション | 転送時の自動番号識別(ANI)です。なお、これは type が「voice」であるインタラクションに適用されます。 | |
| phoneNumber | 文字列 | オプション | 着信先の電話番号です。なお、これは type が「voice」であるインタラクションに適用されます。 | |
| startTime | 数値 | オプション | インタラクションの開始日時 | |
| endTime | 数値 | オプション | インタラクションの終了日時 | |
| duration | 数値 | オプション | インタラクションの継続時間(秒単位) | |
| attachedData | オブジェクト | 必須 | シナリオからインタラクションに添付されたキーと値のペア | |
| origination | 文字列 | オプション | インタラクションがどのように開始されたかを示します。事前定義された値のリストがあります。 |
リクエスト例
const interactionsList: InteractionData[] = [];
function interactionRemovedCallback(data: InteractionData) {
const delIndex = interactionsList.findIndex(item => item.interactionId === data.interactionId);
if (delIndex !== -1) {
interactionsList.splice(delIndex, 1);
}
}
adApi.on("ON_INTERACTION_REMOVED", interactionRemovedCallback);
戻り値
null