【发布时间】:2019-05-15 18:00:18
【问题描述】:
我正在尝试在 C# 中使用 Smartsheet API 的 sdk 从 smartsheet 中获取行并将它们保存在其他地方。尝试初始化 SmartsheetClient 时,我收到 FileNotFoundException。我在 Postman 中使用了我的访问令牌,它可以工作。我是否需要指定有关客户端或令牌的任何内容才能进行初始化?
我正在使用 Visual Studio(社区 2019)在 C# 中工作,我已经安装了 smartsheet-csharp-sdk NuGet 包。我查看了 Smartsheet API 文档,并通过邮递员手动成功地执行了该过程。
//using System
//using Smartsheet.Api;
//using Smartsheet.Api.Models;
//using Smartsheet.Api.OAuth;
//using System.Net.Http;
//using System.Net;
//using System.Web;
//using System.Web.Http;
Token token = new Token();
token.AccessToken = "{my access token}";
SmartsheetClient smartsheet =
new SmartsheetBuilder().SetAccessToken(token.AccessToken).Build();
我希望 SmartsheetClient 能够初始化,以便我可以使用它来获取工作表中的数据,但它却引发了错误。
【问题讨论】: