提供: Bright Pattern Documentation
• English
getChatTranscript
チャットのやり取りに関するチャットトランスクリプトを取得し、チャット中にやり取りされたメッセージのリストを返します。Communicator ウィジェット 2.0でのみ利用可能です。
リクエスト
構文
| getChatTranscript(interactionId?: string): Promise<OperationResult<ChatTranscript>> |
ここで:
| type ChatTranscript = {
messages: ChatTranscriptMessage[] } type ChatTranscriptMessage = { id: string timestamp: number text: string senderName: string type: "normal" | "system" } |
パラメータ
| パラメータ | パラメータ値 | データ型 | オプション/必須 | 説明 |
| interactionId | 文字列 | オプション | トランスクリプトを取得するチャットインタラクションです。interactionId を省略した場合は、現在アクティブなインタラクションが使用されます。 |
リクエスト例
getChatTranscriptButton.onclick = async () => {
const interactionId = interactionsList[0]?.interactionId;
const result = await adApi.getChatTranscript(interactionId);
if (result.status === "成功") {
console.log(result.data.messages);
}
};
戻り値
| オブジェクト | オブジェクトの値 | データ型 | オプションですか?(はい/いいえ) | 値の説明 |
| ChatTranscript | ||||
| メッセージ | ChatTranscriptMessage[] | N | チャットメッセージの配列 | |
| id | 文字列 | N | 一意のメッセージid | |
| timestamp | 数値 | N | メッセージのタイムスタンプ | |
| テキスト | 文字列 | N | メッセージ本文のコンテンツ | |
| senderName | 文字列 | N | 送信者の表示名 | |
| 入力 | 文字列 | N | メッセージの種類:「normal」または「system」 |