Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amazon connect contact flows attributes for InitialMessage #34

Closed
amicming opened this issue Nov 11, 2020 · 2 comments
Closed

amazon connect contact flows attributes for InitialMessage #34

amicming opened this issue Nov 11, 2020 · 2 comments

Comments

@amicming
Copy link

Any Idea How do I supply initial message ? I'm referring this link - https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html.

"InitialMessage": { 
      "Content": "string",
      "ContentType": "string"
   }

I also tried this - #21 .

I can get Name or some value in amazon connect contact flows. Is there a specific way to get InitialMessage?

@efh365
Copy link
Contributor

efh365 commented Nov 11, 2020

You should be able to add an initial message by adding a field to the initiate chat function:

connect.ChatInterface.initiateChat({
name: customerName,
initialMessage: "message here",
username: username,
region: ${region},
apiGatewayEndpoint: "https://${apiId}.execute-api.${region}.amazonaws.com/Prod",
contactAttributes: JSON.stringify({
"customerName": customerName
}),
contactFlowId: "${contactFlowId}",
instanceId: "${instanceId}"
},successHandler, failureHandler)

You will then need to modify the startChat lambda function to pull the message off of the event body and pass it into the start chat api

@amicming
Copy link
Author

Thanks @efh365 . This solution is now working. I added below code in front end side

contactAttributes: JSON.stringify({
  initialMessage: "Test message here"
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants