Transcript from a chat

I am using the PureCloudPlatformClientV2 python client. I have been able to download audio files by following the tutorial. How do I get the Transcript from a chat?

image

You use the same APIs for downloading call recordings as you do chat transcripts.

# create an instance of the API class
api_instance = PureCloudPlatformClientV2.RecordingApi();
conversation_id = 'conversation_id_example' # str | Conversation ID
max_wait_ms = 5000 # int | The maximum number of milliseconds to wait for the recording to be ready. Must be a positive value. (optional) (default to 5000)
format_id = ''WEBM'' # str | The desired media format. Valid values:WAV,WEBM,WAV_ULAW,OGG_VORBIS,OGG_OPUS,MP3,NONE. (optional) (default to 'WEBM')
media_formats = ['media_formats_example'] # list[str] | All acceptable media formats. Overrides formatId. Valid values:WAV,WEBM,WAV_ULAW,OGG_VORBIS,OGG_OPUS,MP3. (optional)

try:
    # Get all of a Conversation's Recordings.
    api_response = api_instance.get_conversation_recordings(conversation_id, max_wait_ms=max_wait_ms, format_id=format_id, media_formats=media_formats)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RecordingApi->get_conversation_recordings: %s\n" % e)

In the response, pull media which has "media" = "message" and then check out the messagingTranscript object.

messagingTranscript
(RecordingMessagingMessage[]) Represents a messaging transcript.
from
(string) The message sender session id.
fromUser
(User) The user who sent this message.
fromExternalContact
(ExternalContact) The PureCloud external contact sender details.
to
(string) The message recipient.
timestamp
(string) The time when the message was sent. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z.
id
(string) A globally unique identifier for this communication.
messageText
(string) The content of this message.
messageMediaAttachments
(MessageMediaAttachment[]) List of media objects attached with this message.
messageStickerAttachments
(MessageStickerAttachment[]) List of message stickers attached with this message.
quickReplies
(QuickReply[]) List of quick reply options offered with this message.
buttonResponse
(ButtonResponse) Button Response selected by user for this message.
story
(RecordingContentStory) Story object.
cards
(Card[]) List of cards offered for this message.
contentType
(string) Indicates the content type for this message.Valid values: QuickReply, Story, Card, Carousel, Attachment, Location, Notification, GenericTemplate, ListTemplate, Postback, Reactions, Mention, ButtonResponse.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.