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

invokesalesforcerestapi 500 error #16

Closed michaelcoallsl closed 1 year ago

michaelcoallsl commented 1 year ago

I am having issues using the ServiceCloudVoiceLambdas - InvokeSalesforceRestApi Functions. Specifically the queryRecord method. I have followed the documentation from your website and when I reach the "Test OAuth with Service Cloud Voice Lambda Function" I get the response { "success": false, "status": 500 } I'd like to note that the invoketelephonyintegration function works correctly and the invokesalesforcerestapi function is using the same key. What is the configuration for the variables suppose to be. Am I required to input my domain name in the endpoints or just using https://test.salesforce.com this is the SOQL query

{  "Details": {     
    "Parameters": {       
       "methodName": 
         "queryRecord",       "soql": "SELECT Id FROM Contact WHERE MobilePhone = '*phonenumber*'"    }  }
}

I've been going off this documenation https://resources.docs.salesforce.com/latest/latest/en-us/sfdc/pdf/support_voice_pt_amazon_connect.pdf and also https://developer.salesforce.com/docs/atlas.en-us.240.0.voice_developer_guide.meta/voice_developer_guide/voice_lambda_oauth_test.htm

jinalkathiara commented 1 year ago

InvokeTelephonyIntegration API and invokeSalesforceRestAPI should use different sets of keys. Can you create a customer case with the Salesforce and our support can guide you more on this.

jinalkathiara commented 1 year ago

You can follow this document - https://developer.salesforce.com/docs/atlas.en-us.240.0.voice_developer_guide.meta/voice_developer_guide/voice_lambda_connected_app_oauth.htm and make sure that you save the digital certificate in the Salesforce connected app as well as private key in the AWS Parameter store for invokeSalesforceRest API lambda.