botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Attachments in version 3.0

Open lucasmdesousa opened this issue 10 years ago • 7 comments

Hello,

Can anyone tell me what's the right way to send attachments in new API version (3.0>)? I've tried it of several ways without success. The only thing I could was send image using base64 encoding. Example:

type: message/image attachments: [ { contentType: 'image/jpg', contentUrl: 'data:image/jpg;base64,[content of file here]' } ]

However, according with documentation, in contentUrl parameter, the url of my image/file would be enough.

I'd really like to know what's the final way to do this, considering images and other types of attachments. Thank you.

lucasmdesousa avatar Jul 28 '16 14:07 lucasmdesousa

Below code is working for me from a .net api. I was initially having issues with protocol mismatch, where I am using my api with https but using http for images. After changing image url's to https they were working.

reply.Attachments = new List<Attachment>();
reply.AttachmentLayout = "carousel";

ThumbnailCard card = new ThumbnailCard();
List<CardImage> image = new List<CardImage>();
image.Add(new CardImage() { Url = "image url" });
card.Title = item.Name;
card.Text = item.Value;
card.Images = image;
reply.Attachments.Add(card.ToAttachment());

rajagottumukkala avatar Jul 28 '16 20:07 rajagottumukkala

@rajarameshvarma I'm using REST API and it seems it doesn't have all the new Skype Bot features... I think it works to you because you are using .NET. I will test again later.

Anyway, thank you.

lucasmdesousa avatar Jul 28 '16 20:07 lucasmdesousa

@lucasmdesousa .NET SDK calls into the same REST API documented here.

msft-shahins avatar Aug 02 '16 19:08 msft-shahins

@lucasmdesousa me too unable to send image from bot.

I am doing the same thing like you but in my case the image is sent and only image image bubble show up with no image and a yellow trialngle in corner in mobile app

ipuneetsingh avatar Aug 14 '16 12:08 ipuneetsingh

@lucasmdesousa is this still an issue or was it resolved? thanks.

Andrea-Orimoto avatar Aug 26 '16 18:08 Andrea-Orimoto

@Andrea-Orimoto I have not tested these last days... I'll do it soon.

lucasmdesousa avatar Aug 29 '16 18:08 lucasmdesousa

Hi @lucasmdesousa, I'm going to close this issue as it's been inactive for a while. If you encounter problems, please file a new issue. Thanks!

dandriscoll avatar Sep 17 '16 22:09 dandriscoll