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

Getting 403 (Forbidden), Microsoft Bot is trying to make a Web Client - download data call

Open barmangaurav opened this issue 10 years ago • 2 comments

I am trying to create a bot using Microsoft BotFramework

The issue I am facing is when the bot code is trying to download data(image which is uploaded by user to the bot) via any channel like Facebook messenger/Skype/Slack. The code to download is by creating a WebClient and making a DownloadData call by passing the attachment URL.

I am able to browse the uploaded image URL. Also, the code for download data via web client works fine if I write a console application rather than a Bot application.

c# Code snippet: WebClient wc = new WebClient(); byte[] bytes = wc.DownloadData(imageUrl); // This line gives 403 error

Kindly suggest what should be the solution for this issue.

barmangaurav avatar Sep 02 '16 11:09 barmangaurav

403 should only appears for Skype. #662 have sample implementation how to fix this issue.

msft-shahins avatar Sep 02 '16 18:09 msft-shahins

Thanks a lot msft-shahins, #662 sample has solved the issue. Your help is much appreciated.

barmangaurav avatar Sep 05 '16 15:09 barmangaurav