你好,
**我是 REST 和 JSON 的新手,但我正在尝试设置 C# 代码以通过 API 将新行添加到 SmartSheet。我已经在 POSTMAN 中对此进行了测试并得到了下面列出的响应,有人知道我缺少什么吗?该令牌已用于在同一个 Smartsheet 上执行 Get 操作而没有问题**
using Smartsheet.Api;
using Smartsheet.Api.Models;
using Smartsheet.Api.OAuth;
// Set the Access Token. Token token = new Token(); token.AccessToken
= "22cskc65swmgihz7znr58xbe9w";
// Use the Smartsheet Builder to create an instance of SmartsheetClient. SmartsheetClient smartsheet = new SmartsheetBuilder().SetAccessToken(token.AccessToken).Build();
// Get current user. smartsheet.UserResources.GetCurrentUser();
// Get server info. smartsheet.ServerInfoResources.GetServerInfo();
Cell[] cellsA = new Cell[] { new Cell.AddCellBuilder(5499304161896324, true).Build(), new Cell.AddCellBuilder
(7751103975581572, "New status").SetStrict(false).Build() };
Row rowA = new Row.AddRowBuilder(true, null, null, null, null).SetCells(cellsA).Build();
Cell[] cellsB = new Cell[] { new Cell.AddCellBuilder(5499304161896324, true).Build(), new Cell.AddCellBuilder
(7751103975581572, "New status").SetStrict(false).Build() };
Row rowB = new Row.AddRowBuilder(true, null, null, null, null).SetCells(cellsB).Build();
smartsheet.SheetResources.RowResources.AddRows(sheetId, new Row[] { rowA, rowB });
使用 POSTMAN 我收到以下错误返回
{
"errorCode": 1008,
"message": "Unable to parse request. The following error occurred: Unrecognized token 'using': was expecting ('true', 'false' or 'null')\n at [Source: REST input; line: 1, column: 7]",
"refId": "13ve7m9i2m942"
}