Newer Version Available
Create Transcripts in Bulk
This API allows you to process transcripts quickly by creating multiple transcripts across different voice calls in one request. The transcript data is sent to the agent console synchronously in real time and persists in Salesforce asynchronously.
If your telephony provider can aggregate multiple transcripts across voice calls, use this API for faster processing, resulting in faster delivery to agents in real time. If your telephony provider is Amazon Connect and you use Contact Lens for Amazon Connect, this API is by default used to process your transcripts.
- 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 aren’t created or stored by the API during this time.
Since this API can contain transcripts for multiple voice calls, if an agent from one voice call pauses a recording or places a call participant on hold, transcription stops for just that voice call; the hold doesn’t interrupt transcription processing for the other voice calls.
To create or update transcripts in bulk after the call has ended, use the Salesforce Connect API.
URI
/telephony/v1/voiceCalls/messages
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 |
|---|---|---|---|
| entries | array | An array of create transcript objects for one or more voice call (VoiceCall) records. | Yes |
| vendorCallKey | string | The unique ID of the voice call (VoiceCall) record within the telephony system for which messages need to be created. | Yes |
| messages | array | An array of individual transcript objects for the voice call (VoiceCall) record. | Yes |
| participantId | string | The call participant role that uttered this text.
|
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 (VoiceCall) record created for the conversation. | Yes |
Example
Request:
1POST /telephony/v1/voiceCalls/messages
2
3{
4 "entries": [
5 {
6 "vendorCallKey": "b09955ce-03be-4335-a28891293zs-18895",
7 "messages": [
8 {
9 "startTime": 1573503300000,
10 "endTime": 1573503300001,
11 "participantId": "b09955ce-03be-4335-a28891293zs-18895END_USER",
12 "messageId": "b09955ce-03be4335xz-a28891293zs",
13 "senderType": "END_USER",
14 "content": "Hello All"
15 },
16 {
17 "startTime": 1573503300002,
18 "endTime": 1573503300003,
19 "participantId": "b09955ce-03be-4335-a28891293zs-18895VIRTUAL_AGENT",
20 "messageId": "b09955ce-03be4335ej-a28891293sz",
21 "senderType": "VIRTUAL_AGENT",
22 "content": "Hello All"
23 }
24 ]
25 },
26 {
27 "vendorCallKey": "b09955ce-03be-4335-a28891293sz-188952",
28 "messages": [
29 {
30 "startTime": 1573503300012,
31 "endTime": 1573503300013,
32 "participantId": "b09955ce-03be-4335-a28891293sz-188952VIRTUAL_AGENT",
33 "messageId": "b2922012ne-t13081984si-t04021978re",
34 "senderType": "VIRTUAL_AGENT",
35 "content": "Hello All"
36 }
37 ]
38 }
39 ]
40}Response:
1// All transcripts were successfully processed.
2{
3 "result": "Accepted"
4}Response with errors:
1// A multi-status error occurred, meaning one or more messages in the request weren’t processed due to an error.
2{
3 "result": "Multi-Status: A few messages were not processed",
4 "errorResponse": {
5 "errorResponseEntries": [
6 {
7 "vendorCallKey": "b09955ce-03be-4335-saturday-18896",
8 "status": 400,
9 "message": "Error Processing Transcript with Id(s) [b09955ce-03be-4335-a8a0-2889129]. Error: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Conversation does not exist"
10 },
11 {
12 "vendorCallKey": "b09955ce-03be-4335-saturday-188954",
13 "status": 202,
14 "message": "Successfully Processed Transcripts with Id(s) [b2922012ne-t13081984si-t04021978re]"
15 },
16 {
17 "vendorCallKey": "ghbjnkk-jlme-6789-friday-67754",
18 "status": 400,
19 "message": "Error Processing Transcript with Id(s) [kjikjnkk-jkjhu-6789-kjgjhg-87643]. Error: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Conversation does not exist"
20 }
21 ]
22 }
23}