ContactDataSync Lambda Function
This Lambda function fetches real-time transcripts generated by Contact Lens for Amazon
Connect and uploads them to Salesforce using Connect REST API. You can manually invoke this
function to backfill missing transcripts in bulk.
Configuration: This function is available to Service Cloud Voice customers who are using an Amazon Connect instance that’s provided by Salesforce. This function is available in Service Cloud Voice contact center version 15.0 and later.
Usage: Call this function manually from the AWS Console or by using the AWS CLI.
- From the AWS Console, select the contactDataSync Lambda function.
- From the Test tab, run the Lambda.
- Use the example payload to run an uploadTranscript operation, substituting your
contactId and relatedRecords values. The
contactId parameter in Amazon Connect is the unique ID of the
voice call record, equivalent to vendorCallKey in Salesforce.
The relatedRecords array lists the 15-digit VoiceCallId.
Here’s an example request payload:
{ "operation": "uploadTranscript", "payload": [ { "contactId": "faaa3a21-5990-48cd-a035-e85ca8c861ff", "relatedRecords": [ "0LQ1Q000002TZtn" ] }, { "contactId": "f15c9342-65a1-41e8-a752-81d630a2890d", "relatedRecords": [ "0LQ1Q000002TAtn" ] } ] }
Here’s an example response:
[ { "StatusCode": 200, "ExecutedVersion": "$LATEST", "Payload": "{\"conversationBulkUploadsResults\":[{\"conversationIdentifier\":\"faaa3a21-5990-48cd-a035-e85ca8c861ff\", \"errorDetail\":null,\"status\":\"SUCCESS\",\"uploadId\":\"f230e3d9-6c0f-3909-a0a8-1b78c634bbde\"}, {\"conversationIdentifier\":\"f15c9342-65a1-41e8-a752-81d630a2890d\",\"errorDetail\":null,\"status\": \"SUCCESS\",\"uploadId\":\"2f30e4d9-6c0f-3109-a0a8-1b78c634cdis\"}] }" }, { "StatusCode": 200, "ExecutedVersion": "$LATEST", "Payload": "{\"conversationBulkUploadsResults\":[{\"conversationIdentifier\":\"f15c9342-65a1-41e8-a752-81d630a2890d\", \"errorDetail\":null,\"status\":\"SUCCESS\",\"uploadId\":\"68279b80-a394-3228-b99b-c60f02ff8227\"}] }" } ]
- Find the uploadId values from the response, and use them to
run an additional fetchUploadIdsStatus
operation that monitors the progress of the transcript upload.
Here’s an example request payload:
{ "operation": "fetchUploadIdsStatus", "uploadIds": [ "f230e3d9-6c0f-3909-a0a8-1b78c634bbde", "68279b80-a394-3228-b99b-c60f02ff8227" ] }
Here’s an example response:
{ "StatusCode": 200, "ExecutedVersion": "$LATEST", "Payload": "{\"conversationBulkUploadStatuses\":[{\"conversationId\":\"fe7095c8-0ec7-48b8-b539-772f4b3c96e4\", \"errorDetail\":null,\"failedEntryCount\":0,\"failedEntryIds\":[],\"lastUpdatedTimestamp\":1714149083044, \"status\":\"SUCCESS\",\"successEntryCount\":2,\"uploadId\":\"ca90995b-802d-39f5-8525-2902a338bcbd\"}] }" }
- Use the example payload to run an uploadTranscript operation, substituting your
contactId and relatedRecords values. The
contactId parameter in Amazon Connect is the unique ID of the
voice call record, equivalent to vendorCallKey in Salesforce.
The relatedRecords array lists the 15-digit VoiceCallId.
Limits:
- You can use this function to backfill and upload transcripts for up to 100 voice calls at a time.
- The timestamps on transcripts that this function backfills and uploads reflect when the function is run, not when the conversation occurred.
- The contactId that this function takes as input must have an associated agent.
- To backfill and upload complete transcripts, end calls only after Amazon has finalized the transcription process. Voice calls that end before the transcription process is finalized result in the partial upload of transcripts for those calls.