How to get a chat transcript

Justyna Kraszewska
5 min read
updated: Mar 25, 2021

If you’d like to keep an additional archive of your chats, you can get complete chat transcripts from LiveChat. This can come in handy if you need to keep past chats on file for all of your agents.

There are a couple ways to go about getting the transcripts.

Getting a transcript from ArchivesLink icon

This is the most basic method that allows you to grab individual chat transcripts. Useful when you don’t need to archive all of your chats but only some cases.

To get a chat transcript from Archives, follow these steps:

  1. Go to Archives and choose the chat you want to get transcript from.
  2. Click on the three dots in the top right to open the action menu.
  3. Select Send transcript from the menu.
  4. Enter your e-mail.
  5. Click on Send copy to finalize.

Forwarding chat transcripts to emailLink icon

You can forward your chat transcripts to a list of emails. To do that, follow these steps:

  1. Go to Settings > Chat settings > Transcript forwarding.
  2. Enter an email address (you can enter more than one, by separating them with a comma).
  3. Click on Save changes to finalize.

Extracting transcripts using the APILink icon

An advanced way of getting your past chats. Using the API allows you to get the transcripts in bulk as well as just the specific conversations.

First of all, you will need a list of your chats. You can use the https://api.livechatinc.com/v2/chats?date_from=2015-05-05&date_to=2015-05-31 method to do that. Using this callback, you will be able to extract all chats from a particular time period.

When calling our Chats endpoint, the response is limited to the latest 100000 records on your LiveChat license, which gives you exactly 4000 pages with 25 chats per page. If you have more than 100000 chats on your license and you want to get them all, you will have to call our API several times.

In the first call, use the data range that covers the first 100000 chats. When making other calls, use the data range that includes the rest of your conversations.

When calling our Chats endpoint, the response is limited to the latest 100000 records on your LiveChat license, which gives you exactly 4000 pages with 25 chats per page. If you have more than 100000 chats on your license and you want to get them all, you will have to call our API several times.

In the first call, use the data range that covers the first 100000 chats. When making other calls, use the data range that includes the rest of your conversations.

Here’s an example request that will return all chats from group 1, starting from the 1st of January, 2015 and for one particular agent only:

curl "https://api.livechatinc.com/chats?date_from=2015-01-01&group=1&agent=john.doe@mycompany.com" -u john.doe@mycompany.com:c14b85863755158d7aa5cc4ba17f61cb  -H X-API-Version:2
When using our API, remember to always use HTTPS certificate, just as in the example above.
When using our API, remember to always use HTTPS certificate, just as in the example above.

To learn more about the filtering options for this methods, check out our API documentation.

If you just need to store the chats, simply save the results to a file. Alternatively, you can use the API to send chats transcripts from the extracted chats to specified emails.

To do that, you need to use the Send chat transcripts to email method. You need to provide the receivers email as well as the CHAT_ID of the conversation (CHAT_IDs are available through the [GET] /chats method).

Here’s an example request:

curl "https://api.livechatinc.com/chats/MH022RD0K5/send_transcript"  -u john.doe@mycompany.com:c14b85863755158d7aa5cc4ba17f61cb  -H X-API-Version:2  -d "to=john.doe@mycompany.com"

If you need to send a bunch of chats this way and/or send them to several recipients, you can write a short script that would loop the request.

Sending transcripts automatically after chatsLink icon

The final and most complex method of getting the chat transcripts involves using a LiveChat webhook. Using this method, you can receive a chat transcript after each of your chats.

Start by creating webhook. Go to the Webhooks section and click on the Add a webhook link.

Add a webhook in LiveChatNext, choose the chat ends option in the Event part of the setup. Leave all Data type options ticked.

You will need to provide the Target URL of the webhook. This should be a file on your server. Create a blank file named “transcript-webhook” (for example in PHP), place it on your server and type in the address in the webhook setup.

Click on Add a webhook to finalize the webhook creation.

Create a webhook in LiveChatFinally, you need to create the aforementioned .php file. The file should include a script that will automatically send a transcript when a chat is finished.

Here’s an example of such file:

<?php

$data = file_get_contents('php://input');
$data = json_decode($data);

if ($data->event_type === 'chat_ended') {
    // code to send email
    mail('myemail@company.com', 'Chat transcript', print_r($data, true));
}
?>

Once the file is on your server, the script will automatically send the transcript to the specified email or emails.

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

RELATED ARTICLES

Share files on chat

Start sharing files on chat using the LiveChat app. Learn how to share screenshots, logs, instructions, and many others.

Read the article

Tag chats and tickets

Tags are labels that you add to chats and tickets. They help you categorize and organize all customer communication in your LiveChat account.

Read the article

Start using LiveChat now!

Free 14-day trial Team plan features No credit card required

Still not convinced? Discover all LiveChat features

Discover our other products