Botframework-sdk: Attachments in version 3.0

Created on 28 Jul 2016  路  7Comments  路  Source: microsoft/botframework-sdk

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.

All 7 comments

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());

@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 .NET SDK calls into the same REST API documented here.

@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

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

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

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!

Was this page helpful?
0 / 5 - 0 ratings