我在下面提到链接
并使用以下行 -
public void downloadAttachment(Attachment attach)
{
SmartsheetRequest getAttachment = new SmartsheetRequest { callURL = "/attachment/" + attach.Id, method = "GET", contentType = "application/json" };
var jsonGetAttachment = getAttachment.MakeRequest("null");
getAttachment.DownloadAttachment(jsonGetAttachment["url"], jsonGetAttachment["sizeInKb"], jsonGetAttachment["name"]);
}
下载附件。
但是以下一行
Stream responseStream = request.GetResponse().GetResponseStream();
“MakeRequest”方法中的给出“远程服务器返回错误:(404)Not Found。”错误。
答案 0 :(得分:0)
我找到了解决问题的方法。
解决方案: -
以下代码行 -
SmartsheetRequest getAttachment = new SmartsheetRequest { callURL = "/attachment/" + attach.Id, method = "GET", contentType = "application/json" };
更改为以下行 -
SmartsheetRequest getAttachment = new SmartsheetRequest { callURL = "/sheets/" + SheetID + "/attachments/" + attach.Id, method = "GET", contentType = "application/json"};