service-cloud-voice / ServiceCloudVoiceLambdas

This application provides a set of Lambda functions, which are available within your Amazon Connect instance after provisioning the instance with your Service Cloud Voice contact center. You can use these Lambdas in Amazon Connect contact flows.
BSD 3-Clause "New" or "Revised" License
14 stars 18 forks source link

Using postCallAnalysisTrigger with out of the box SCV #83

Open dschueler opened 4 months ago

dschueler commented 4 months ago

I am trying to setup the Sentiment Journey data synch as outlined here: https://help.salesforce.com/s/articleView?id=sf.voice_conversation_sentiments.htm&type=5

postCallAnalysisTrigger is getting invoked but gets a 403 error.

Any thoughts?

andy-thomas-83 commented 1 week ago

I am also getting this error. The URL used to post to Salesforce seems to be using the S3 object ARN:

/voiceCalls/13e36ed6-cbca-4dc6-b122-09a96f046df2/postConversationEvents

Which is captured in the metadata field for the S3 object. Is this how the relationship between voice call record and AWS S3 Objects are managed?

Lambda Log shows:

"baseURL": "https://{{removed}}.my.salesforce-scrt.com/telephony/v1", "data": "{\"service\":\"AmazonConnectContactLens\",\"events\":[{\"type\":\"IntelligenceSignal__OverallSentimentScore\",\"value\":\"0\",\"startTime\":1724432183752,\"endTime\":1724432240522,\"participant\":\"AGENT\"},{\"type\":\"IntelligenceSignal__OverallSentimentScore\",\"value\":\"0\",\"startTime\":1724432183752,\"endTime\":1724432240522,\"participant\":\"CUSTOMER\"},{\"type\":\"IntelligenceSignal__Sentiment\",\"value\":\"0\",\"startTime\":1724432191037,\"endTime\":1724432192507,\"participant\":\"AGENT\"},{\"type\":\"IntelligenceSignal__Sentiment\",\"value\":\"0\",\"startTime\":1724432200637,\"endTime\":1724432201067,\"participant\":\"CUSTOMER\"},{\"type\":\"IntelligenceSignal__Sentiment\",\"value\":\"0\",\"startTime\":1724432201767,\"endTime\":1724432201847,\"participant\":\"CUSTOMER\"},{\"type\":\"IntelligenceSignal__Sentiment\",\"value\":\"0\",\"startTime\":1724432204287,\"endTime\":1724432204297,\"participant\":\"CUSTOMER\"},{\"type\":\"IntelligenceSignal__Sentiment\",\"value\":\"0\",\"startTime\":1724432212277,\"endTime\":1724432214867,\"participant\":\"AGENT\"},{\"type\":\"IntelligenceSignal__Sentiment\",\"value\":\"0\",\"startTime\":1724432227597,\"endTime\":1724432232227,\"participant\":\"AGENT\"}]}", "env": {}, "headers": { "Accept": "application/json, text/plain, */*", "Accept-Encoding": "gzip, compress, deflate, br", "Authorization": "Bearer {{REMOVED }}", "Content-Length": "1085", "Content-Type": "application/json", "Telephony-Provider-Name": "amazon-connect", "User-Agent": "axios/1.6.4" }, "maxBodyLength": -1, "maxContentLength": -1, "method": "post", "timeout": 0, "transformRequest": [ null ], "transformResponse": [ null ], "transitional": { "clarifyTimeoutError": false, "forcedJSONParsing": true, "silentJSONParsing": true }, "url": "/voiceCalls/13e36ed6-cbca-4dc6-b122-09a96f046df2/postConversationEvents", "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN" }, "message": "Request failed with status code 403", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 403\n at settle (/opt/nodejs/node_modules/axios/dist/node/axios.cjs:1970:12)\n at IncomingMessage.handleStreamEnd (/opt/nodejs/node_modules/axios/dist/node/axios.cjs:3065:11)\n at IncomingMessage.emit (node:events:529:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1400:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)", "status": 403 }, "level": "error", "message": "Error sending Persist signals", "timestamp": "2024-08-23 17:28:11" }