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.

S_Ali
已提問 5 個月前檢視次數 210 次
1 個回答
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
支援工程師
Ankur_V
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南