I am using Web Client to download yammer attachments i tried to use all different URL's available by yammer API / browser :
-download URL -large preview URL -right click and copy image URL
file is downloaded with 0 bytes
any suggestion ?
to download Yammer attachments you need both Download URl and Access token as below
string Path = @"C:\SocialMediaDownloads\Yammer\Attachments\"+MessageId;
bool isExists = System.IO.Directory.Exists(Path);
if (!isExists)
System.IO.Directory.CreateDirectory(Path);
WebClient client = new WebClient();
client.BaseAddress = "https://www.yammer.com";
client.Headers["Authorization"] = "Bearer " + accessToken;
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadDataCompleted);
client.DownloadFileAsync(new Uri(URL),Path+@"\"+FileName);
return Path;
}