getInteractionsState
Communicator ウィジェットにおけるインタラクションの現在の状態を取得するためのリクエストです。通常、API に接続済みの場合、またはページが更新された後に、このデータを一度リクエストすることをお勧めします。これにより、現在の初期状態を復元することができます。
リクエスト
構文
| getInteractionsState(): Promise<OperationResult<InteractionsState>> |
:
| type InteractionsState = {
activeInteractionId: string | null interactions: InteractionData[] }
interactionId: string 状態: InteractionState type: InteractionType callParties: CallParty[] chatParties: ChatParty[] callMuted: boolean callRecording: boolean attachedData: AttachedData 内線: boolean phoneNumber?: string メール?: string callDirection?: CallDirection startTime?: number endTime?: number duration?: number description?: string disposition?: string globalInteractionId?: string サービス?: string playbackUrl?: string recordingUrl?: string DNIS?: string ANI?: 文字列 origination?: InteractionOrigination } type InteractionType = "音声" | "チャット" | "メール" type InteractionState = "不明" | "キュー" | "ivr" | "wrap_up" | "wrap_up_hold" | "delivered" | "delivery_pending" | "hold" | "completed" type InteractionOrigination = "dialpad" | "dialpad-検索" | "ディレクトリ" | "履歴" | "お気に入り" | "ワークアイテム" | "インターアクション" | "連絡先プロフィール" | "ヘルプ" | "会議" | "オート" | "統合API" type CallDirection = "インバウンド" | "アウトバンド" type CallParty = { id: string name: string 電話: string userId?: string } type ChatPartyType = "内線" | "外部" type ChatParty = { id: string type: ChatPartyType name: string userId?: string contactId?: string email?: string 電話?: string } |
パラメータ なし
リクエスト例
let activeInteractionId = null
let initialInteractionDataLoaded = false
const adApi = new AgentDesktopClientAPIImpl()
adApi.getInteractionsState().then(data => {
if (data.status === '成功') {
console.info('初期のインタラクション状態:', data.data)
activeInteractionId = data.data.activeInteractionId
initialInteractionDataLoaded = true
} else {
if (data.error.name === 'not_logged_in') {
activeInteractionId = null
initialInteractionDataLoaded = true
}
console.warn('インタラクションの状態を取得できませんでした:', data.error)
}
})
戻り値
| オブジェクト | オブジェクトの値 | データ型 | オプション?
(Y/N) |
値の説明 |
| InteractionsState | ||||
| インタラクションの現在の状態をカプセル化したデータ | ||||
| activeInteractionId | 文字列またはnull | N | アクティブなインタラクションのid。アクティブなインタラクションがない場合はnull | |
| interactions | InteractionData[] | N | その時点におけるすべてのエージェントの相互作用とその全データのリスト | |
| InteractionData | ||||
| 1つのインタラクションを表すデータ | ||||
| 入力 | 文字列 | 必須 | インタラクションのタイプを示します。認識されるタイプは以下の通りです:
| |
| interactionId | 文字列 | 必須 | インタラクションのid | |
| globalInteractionId | 文字列 | オプション | インタラクションのグローバルインタラクション id (GIID) | |
| サービス | 文字列 | オプション | そのインタラクションに関連するサービスの名前 | |
| callParties | CallParty[] | 必須 | 通話参加者のリストを提供します。なお、これは type が「音声」であるインタラクションに適用されます。各項目は以下の通りです:
| |
| chatParties | ChatParty[] | 必須 | チャットの参加者のリストを提供します。なお、これは type が「chat」であるインタラクションに適用されます。詳細:
| |
| callMuted | ブール値 | 必須 | true に設定するとコールのミュートが有効になり、false に設定するとミュートが有効になりません。コール以外のやり取りでは常に false となる点にご注意ください。 | |
| callRecording | ブール値 | 必須 | true に設定すると、通話録音機能が有効になります。false に設定すると、通話録音機能は無効になります。なお、通話以外の操作については、常に false に設定されます。 | |
| disposition | 文字列 | オプション | この渡されたインタラクションのdispositionカテゴリーの名前 | |
| 説明 | 文字列 | オプション | そのインタラクションについてエージェントが追加したメモ | |
| recordingUrl | 文字列 | オプション | 通話録音のURLです。なお、これは「type」が「音声」であるインタラクションに適用されます。 | |
| playbackUrl | 文字列 | オプション | 通話録音の再生用URLです。なお、これは「音声」タイプのインタラクションにのみ適用されます。 | |
| callDirection | 文字列 | オプション | コールのタイプです。認識される方向は以下の通りです:
なお、これはタイプが「音声」であるインタラクションに適用されます。 | |
| 内線 | ブール値 | 必須 | インタラクションが内線(別のエージェントとの間)であるか、外部の顧客との間であるかを示します。 | |
| DNIS | 文字列 | オプション | ダイヤル番号認識サービス (DNIS)。なお、これはタイプが「音声」であるインタラクションに適用されます。 | |
| ANI | 文字列 | オプション | 転送時の自動番号識別(ANI)です。なお、これはタイプが'「音声」であるインタラクションに適用されます。 | |
| phoneNumber | 文字列 | オプション | 受信先の電話番号です。なお、これはタイプが'「音声」であるインタラクションに適用されます。 | |
| startTime | 数値 | オプション | インタラクションの開始日時 | |
| endTime | 数値 | オプション | インタラクションの終了日時 | |
| duration | 数値 | オプション | インタラクションの duration(秒単位) | |
| 添付データ | オブジェクト | 必須 | シナリオからインタラクションに添付されたキーと値のペア | |
| 発生元 | 文字列 | オプション | インタラクションがどのように開始されたかを示します。あらかじめ定義された値のリストがあります。 |