We have a form on our site that adds a row to two sheets in Smartsheet. This broke in June at which time the form added a row to the first sheet, but failed in the API call to Smartsheet in adding a row to the second sheet.
Example Code that submitted to the first sheet (this was not affected):
protected void SendFormInfoToSmartsheet() {
string smartsheetAPIToken = ConfigurationManager.AppSettings["SWTCSmartsheetToken"];
Token token = new Token();
token.AccessToken = smartsheetAPIToken;
// Use the Smartsheet Builder to create an instance of SmartsheetClient
SmartsheetClient smartsheet = new SmartsheetBuilder().SetAccessToken(token.AccessToken).Build();
// Specify cell values for first row.
Cell[] cellsA = new Cell[] {
new Cell.AddCellBuilder(645402597xxxxxx, DateOfIncident.Text).Build(),
new Cell.AddCellBuilder(2897202411xxxxxx, name.Text).Build(),
new Cell.AddCellBuilder(7400802038xxxxxx, phone.Text).Build(),
new Cell.AddCellBuilder(1771302504xxxxxx, email.Text).Build(),
new Cell.AddCellBuilder(6274902132xxxxxx, complaintType.SelectedItem.Text).Build(),
new Cell.AddCellBuilder(4023102318xxxxxx, protectedClass.Text).Build(),
new Cell.AddCellBuilder(363927621xxxxxx, serviceArea.SelectedItem.Text).Build(),
new Cell.AddCellBuilder(8526701945xxxxxx, issue.Text).Build()
};
// Specify contents of first row.
Row rowA = new Row.AddRowBuilder(true, null, null, null, null).SetCells(cellsA).Build();
// Add rows to sheet.
smartsheet.SheetResources.RowResources.AddRows(272967129xxxxxx, new Row[] {rowA});
The code that follows (which is within the same aspx.cs file) started failing some time between June 5, 2018 and July 27, 2018. The IDs such as nameID, were declared in a case statement which set the IDs for each sheet column within the submitted row.
case "Billing Dispute":
sheetID = 463297182xxxxxx;
DateOfIncidentID = 453226612xxxxxx;
nameID = 6784065941xxxxxx;
phoneID = 115456640xxxxxx;
emailID = 565816603xxxxxx;
complaintTypeID = 3406366xxxxxx;
protectedClassID = 790996584xxxxxx;
serviceAreaID = 509521608xxxxxx;
issueID = 59161645xxxxxx;
emailReturn = "'Fname Lname' <email@domain.com>";
leadStaff = "Fname Lname";
break;
Cell[] cellsB = new Cell[] {
new Cell.AddCellBuilder(DateOfIncidentID, DateOfIncident.Text).Build(),
new Cell.AddCellBuilder(nameID, name.Text).Build(),
new Cell.AddCellBuilder(phoneID, phone.Text).Build(),
new Cell.AddCellBuilder(emailID, email.Text).Build(),
new Cell.AddCellBuilder(complaintTypeID, complaintType.Text).Build(),
new Cell.AddCellBuilder(protectedClassID, protectedClass.Text).Build(),
new Cell.AddCellBuilder(serviceAreaID, serviceArea.Text).Build(),
new Cell.AddCellBuilder(issueID, issue.Text).Build()
};
// Specify contents of first row.
Row rowB = new Row.AddRowBuilder(true, null, null, null, null).SetCells(cellsB).Build();
// Add rows to sheet.
smartsheet.SheetResources.RowResources.AddRows(sheetID, new Row[] { rowB });
SendEmailNotifications(emailReturn, leadStaff);
The issue was somehow fixed by attempting to update the SDK in our solution within Visual Studio.
As we did not change any of our code during this time, I can only assume that something on the Smartsheet API 2.x was updated and not backward compatible.
Just thought I would attempt to document this issue. Hopefully it will be helpful to others.