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

Created on 2 Sep 2016  路  2Comments  路  Source: microsoft/botframework-sdk

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.

help wanted

Most helpful comment

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

All 2 comments

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

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

Was this page helpful?
0 / 5 - 0 ratings