我刚开始使用API更新智能工作表文档。在公司防火墙后面访问SmartSheet API C#
在SDK参考中使用示例(csharp-read-write-sheet),只要我在打开的Internet连接上,我就可以更新文档,但是,当我连接到公司LAN时它报告了代理身份验证问题。
这是从SDK代码
string accessToken = ConfigurationManager.AppSettings["AccessToken"];
if (string.IsNullOrEmpty(accessToken))
accessToken = Environment.GetEnvironmentVariable("SMARTSHEET_ACCESS_TOKEN");
if (string.IsNullOrEmpty(accessToken))
throw new Exception("Must set API access token in App.conf file");
// Get sheet Id from App.config file
string sheetIdString = ConfigurationManager.AppSettings["SheetId"];
long sheetId = long.Parse(sheetIdString);
// Initialize client
SmartsheetClient ss = new SmartsheetBuilder().SetAccessToken(accessToken).Build();
// Load the entire sheet
Sheet sheet = ss.SheetResources.GetSheet(sheetId, null, null, null, null, null, null, null);
Console.WriteLine("Loaded " + sheet.Rows.Count + " rows from sheet: " + sheet.Name);
能否请您指教我该怎么配置API提供System.Net.WebProxy
对象到客户端API通过公司代理提供认证路线
好的,谢谢......但是,您能否将此添加为下一个发布周期的功能。 –
唯一的问题是,这不允许提供凭据(请参阅下面的我自己的答案) –
是的,添加到我们的积压 –