how to send additional information with file in amazon connect chat api's sendAttachment method

0

Success Case: I am using amazon-connect-chatjs sendAttachment method to send attachments . It is working fine.

await controller.sendAttachment({ attachment: file})

I have to send some additional information with a file to my backend, which I wrote using Amazon Connect Chat APIs. I have different types of channels (whatsapp) communicating with my frontend using that backend. I have to make a decision on the additional information to whom I have to send the attachment. Is there any way to add my additional information with a send attachment and get this information on the WebSocket onMessage event? Please guide me on how I can achieve that approach.

i want something like this:

await controller.sendAttachment({ attachment: file}, {additional information}) or await controller.sendAttachment({ attachment: file, additional information})

I've tried the above approach but got same attachment response on WebSocket as previous, all the information got ignored or removed.

1 Answer
0

Hello,

Greetings!

Based on your query, Unfortunately there’s not a way to add metadata currently on the attachment upload itself.

However, in order to support on all the best possible way, I would suggest trying the below Ideas and see if that helps.

Some ideas might be:-

  1. Set contact attributes on the contact
  2. Right before sending that attachment, send a message with application/json type, to provide metadata (this content type isn’t rendered, and is intended for metadata)

[+] SendMessage https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_SendMessage.html

[+] Flow block: Set contact attributes https://docs.aws.amazon.com/connect/latest/adminguide/set-contact-attributes.html

[+] UpdateContactAttributes https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateContactAttributes.html

I hope the above information is helpful.

Thanks again for reaching out to us! Looking forward to hearing from you.

AWS
SUPPORT ENGINEER
Ankur_V
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions