提供: Bright Pattern Documentation
移動先: 案内、 検索
• English

onSaveActivityRecord

このハンドラーは、完了したインタラクションの対応記録(アクティビティレコード)を保存するタイミングで呼び出されます。このイベントには、インタラクションに関するすべてのデータが含まれます(onInteractionEnd コールバックのインタラクションデータと同一です)。

リクエスト

構文

on('ON_SAVE_ACTIVITY_RECORD', handler: OnSaveActivityRecordHandler): void


type OnSaveActivityRecordHandler = (activity: InteractionData) => void


type InteractionData = {

   interactionId: string
   state: InteractionState
   type: InteractionType
   subject: string
   associatedObjects: InteractionAssociatedObjectsData
   callParties: CallParty[]
   callMuted: boolean
   callRecording: boolean
   attachedData: AttachedData
   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

}


パラメータ

パラメータ パラメータ値 データ型 オプション/必須 説明
interactioninteractionId 文字列 必須 終了したインタラクションのID
type 文字列 必須 インタラクションのタイプを示します。認識されるタイプは以下の通りです:
  • "voice"
  • "chat"
  • "email"
agentId 文字列 必須 エージェントのID
interactionId 文字列 必須 インタラクションのID
globalInteractionId 文字列 オプション インタラクションのグローバルインタラクションID (GIID)
service 文字列 オプション そのインタラクションに関連するサービスの名前
callParties 文字列 必須 通話参加者のリストを提供します。なお、これは type が "voice" であるインタラクションに適用されます。 詳細:
  • id
    • 一意の参加者ID
  • name
    • 参加者の表示名
  • phone
    • 使用された電話番号
  • userId?
    • (オプション)一意のユーザーIDです。つまり、getTeamMembers メソッドから取得した TeamMember リストエントリのIDです。相手が内部ユーザーでない場合、userId は未定義となります
callMuted ブール値 必須 true に設定するとコールがミュートされ、false に設定するとコールはミュートされません。なお、コール以外のインタラクションでは常に false となります。
callRecording ブール値 必須 true に設定すると通話録音が有効になり、false に設定すると通話録音は無効になります。なお、コール以外のインタラクションでは常に false に設定されます。
disposition 文字列 オプション このインタラクションのディスポジションカテゴリーの名前
recordingUrl 文字列 オプション 通話録音のURLです。なお、これは type が "voice" であるインタラクションに適用される点にご注意ください。
callDirection 文字列 オプション コールのタイプです。認識される方向は以下の通りです:
  • "inbound"
  • "outbound"

なお、これは type が "voice" であるインタラクションに適用されます。

DNIS 文字列 オプション 着信番号情報サービス (DNIS) です。なお、これは type が "voice" であるインタラクションに適用される点にご注意ください。
transferANI ? オプション 転送時の発信者番号識別(ANI)です。なお、これは type が "voice" であるインタラクションに適用されます。
phoneNumber 文字列 オプション 着信先の電話番号です。なお、これは type が "voice" であるインタラクションに適用されます。
startTime 数値 オプション インタラクションの開始日時
endTime 数値 オプション インタラクションの終了日時
duration 数値 オプション インタラクションの継続時間(秒単位)
origination 文字列 オプション インタラクションがどのように開始されたかを示します。あらかじめ定義された値のリストがあります。

リクエスト例

function saveActivityRecordCallback(activity: InteractionData) {

postActivityLog(covertInteractionToActivity(activity));

}

adApi.on("ON_SAVE_ACTIVITY_RECORD", saveActivityRecordCallback);

戻り値

null

< 前へ | 次へ >