I am attempting to use an external form (on our website written in C#) and the API 2.0 to insert a row into a sheet. I am reading the API 2.0 Documentation (at http://smartsheet-platform.github.io/api-docs/?csharp#add-row(s)) but cannot figure out where I place the actual values submitted from the form within this code to be added as a new row. Any help would be welcome!
The API 1.x code went something like this:
string smartsheetAPIToken = ConfigurationManager.AppSettings["SWTCSmartsheetToken"];
long sheetID = 5551212345678910; //Smartsheet ID
Token token = new Token();
token.AccessToken = smartsheetAPIToken;
SmartsheetClient smartsheet = new SmartsheetBuilder().SetAccessToken(token.AccessToken).Build();
List<Column> cols = new List<Column>(smartsheet.Sheets().Columns().ListColumns(sheetID));
Cell cell1 = new Cell();
cell1.ColumnId = cols[0].ID;
cell1.Value = DateTime.Now; //Date Time added
Cell cell2 = new Cell();
cell2.ColumnId = cols[1].ID;
cell2.Value = firstName.Text; //First Name
Cell cell3 = new Cell();
cell3.ColumnId = cols[2].ID;
cell3.Value = lastName.Text; //Last Name
Cell cell4 = new Cell();
cell4.ColumnId = cols[3].ID;
cell4.Value = email.Text; //Email
List<Cell> cells = new List<Cell>();
cells.Add(cell1);
cells.Add(cell2);
cells.Add(cell3);
cells.Add(cell4);
Row row = new Row();
row.Cells = cells;
List<Row> rows = new List<Row>();
rows.Add(row);
RowWrapper rowWrapper = new RowWrapper.InsertRowsBuilder().SetRows(rows).SetToBottom(true).Build();
smartsheet.Sheets().Rows().InsertRows(sheetID, rowWrapper);