smartsheet / smartsheet-csharp-sdk

Library that uses C# to connect to Smartsheet services.
Apache License 2.0
13 stars 7 forks source link

Add Image to cell with latest version #57

Open mermich opened 7 months ago

mermich commented 7 months ago

Hi, Some of the latest changes on the SDK concerned the httpClient, and I think a regression was created around cell image. Previously setting a cell image was working as the documentation says :

// Set options Image image = new Image { AltText = "Caution Sign", Height = 16, Width = 16 };

smartsheet.SheetResources.RowResources.CellResources.AddImageToCell( 1696831624483716, // sheetId 1049441315358596, // rowId 74761903175665540, // columnId "/Users/jdoe/Documents/images/img_pl_decisionshapesHold.png", "image" );

But currently while doing something similar i got an error relative to the content type. Thus I had to change the request such as :

// Set options Image image = new Image { AltText = "Caution Sign", Height = 16, Width = 16 };

smartsheet.SheetResources.RowResources.CellResources.AddImageToCell( 1696831624483716, // sheetId 1049441315358596, // rowId 74761903175665540, // columnId "/Users/jdoe/Documents/images/img_pl_decisionshapesHold.png", null );

As we see the modification is quite small but I've to edit code that was previously working.