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, callback calls, and consult calls. The transcript data is sent to the rep 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 rep 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.

In consult call use cases where a consult call hasn't merged with a multiparty call, use the vendorCallKey of the voice call record created for the consult call. To transcribe a consult call after it has merged with a multiparty call, use the vendorCallKey of the first voice call record created for the multiparty call.

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 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. For consult calls that haven't been merged with a multiparty call, {vendorCallKey} is the vendorCallKey of the VoiceCall created for the consult call. If you set this property to any other value, Salesforce will set it to {vendorCallKey}END_USER internally for privacy reasons.
  • If senderType is EXTERNAL_USER, set this value to the unique ID for the external call participant generated by the telephony partner.
  • If senderType is HUMAN_AGENT, enter the rep’s 15-digit or 18-digit Salesforce user ID (starts with 005).
  • If senderType is SUPERVISOR, set this value to {vendorCallKey}SUPERVISOR, 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}SUPERVISOR internally for privacy reasons.
  • 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.
  • EXTERNAL_USER - Represents a contact external to your Salesforce organization.
  • HUMAN_AGENT - Represents a rep.
  • SUPERVISOR - Represents a supervisor. For example, a supervisor generates an utterance when they barge into a call between a customer and rep and start talking.
  • VIRTUAL_AGENT - Set this value to VIRTUAL_AGENT when you have a conference between multiple reps and you want to create all rep-side utterances as one single rep since you have no way to differentiate between the different reps 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}

Request:

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

Request:

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

Response:

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