Newer Version Available

This content describes an older version of this product. View Latest

Create a Transcript

Creates a transcribed version of a voice call in real time.

Use this API to create transcripts for one voice call in real time. Voice calls can include inbound calls, transfer calls, outbound calls, and callback calls. The transcript data is sent to the agent console synchronously in real time and will be persisted in Salesforce asynchronously.

This API and the Create Transcripts in Bulk API (/telephony/v1/voiceCalls/messages) share several characteristics.
  • Both APIs create voice call transcripts if the timestamp of the transcript is between the start and end times of the conversation.
  • Both APIs pause call transcription whenever the agent pauses the recording or places the call participant on hold. Any messages being sent in won’t be created or stored by the API during this time.
Where the two APIs differ is by the number of transcripts they can process per request. This API only creates transcripts for one voice call at a time, while the Create Transcripts in Bulk API creates transcripts in bulk.

To create or update transcripts in bulk after the call has ended, use the Salesforce Connect API.

URI

/telephony/v1/voiceCalls/{vendorCallKey}/messages

Where vendorCallKey is the unique ID of the voice call (VoiceCall) record within the telephony system. For example, if the telephony system is Amazon Connect, this value is the contact ID in Amazon Connect. In transfer use cases where there are multiple VoiceCall objects associated to a single call, use the vendorCallKey of the first voice call record created for the call. This value can only be the unique call identifier of the first contact for the conversation. This value can't be a Salesforce voiceCallId.

HTTP Method

POST

Headers

Authorization: Bearer <token>

String. Standard header. The authorization token, where <token> is the JSON Web Token (JWT). Required.

Content-Type: <format>
String. Standard header. The format of the request body. Valid formats include JSON and XML. For example, application/json or application/xml. Required.
Telephony-Provider-Name: <telephony provider name>
String. Custom header. The name of the telephony provider that calls this API. For example, Amazon Connect.

Parameters

Property Name Type Description Required
participantId string The call participant role that uttered this text.
  • If senderType is END_USER, set this value to {vendorCallKey}END_USER, where {vendorCallKey} is the vendor call key (vendorCallKey) of the first voice call (VoiceCall) record created for the conversation. If you set this property to any other value, Salesforce will set it to {vendorCallKey}END_USER internally for privacy reasons.
  • If senderType is HUMAN_AGENT, enter the agent's 15-digit or 18-digit Salesforce user ID (starts with 005).
  • If senderType is VIRTUAL_AGENT, set this value to {vendorCallKey}VIRTUAL_AGENT, where {vendorCallKey} is the vendor call key (vendorCallKey) of the first voice call (VoiceCall) record created for the conversation. If you set this property to any other value, Salesforce will set it to {vendorCallKey}VIRTUAL_AGENT internally for privacy reasons.
Yes
messageId string The unique ID of the message. This value has to be unique for the given conversation. Yes
startTime int64 The date and time (in UTC) when this utterance started. Measured in milliseconds since the Unix epoch. Yes
endTime int64 The date and time (in UTC) when this utterance ended. Measured in milliseconds since the Unix epoch. Yes
content string The actual text of the utterance. Yes
senderType string the voice call participant role that generated the utterance. Possible values are:
  • END_USER - Represents a customer.
  • HUMAN_AGENT - Represents an agent.
  • VIRTUAL_AGENT - Set this value to VIRTUAL_AGENT when you have a conference between multiple agents and you want to create all agent-side utterances as one single agent since you have no way to differentiate between the different agents in the audio stream. The sender in this case must be the vendor call key (vendorCallKey) of the first voice call record created for the conversation.
Yes

Example

Request:

1POST telephony/v1/voiceCalls/5324881f-1e84-4367-8930-f69a74b30ca6/messages
2
3{
4  "participantId": "5324881f-1e84-4367-8930-f69a74b30ca6VIRTUAL_AGENT",
5  "messageId": "57904eb6-5352-4c5e-adf6-5f100572cf5d116",
6  "startTime": 1573503300000,
7  "endTime": 1573503300000,
8  "content": "Hello All",
9  "senderType": "VIRTUAL_AGENT"
10}

Response:

1{
2  "result": "Accepted"
3}