7

Using Smartsheet 2.0 APi sto update smartsheets using CURL in my application. The request is 

Request Header = PUT /2.0/sheets/6988860577081220/rows?allowPartialSuccess=false HTTP/1.1 Authorization: Bearer XXXXXXXXX

Host: api.smartsheet.com Content-Type: application/json

data to be sent:

{"id":2222,"cells":[{"columnId":33333,"value":"Offline","displayValue":"Offline"}

]}

 

Response.ContentString =

HTTP/1.1 200 OK Date: Fri, 03 May 2019 12:40:33 GMT Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 Content-Type: application/json;charset=UTF-8 Content-Length: 882 Vary: Accept-Encoding {"message":"SUCCESS","resultCode":0,"result":[{"id":2222,"rowNumber":1,"expanded":true,"createdAt":"2018-10-15T08:19:33Z","modifiedAt":"2019-05-03T12:40:34Z","cells":[{"columnId":33333,"value":"Offline","displayValue":"Offline"}

]}],"version":1615}

 

The above response is not a valid json. Pleae suggest if i am doing something wrong

Comments

The response contains a SUCCESS message from the Smartsheet API, so this looks to be going through. have you checked in the sheet to see if the change is happening as expected?

The Smartsheet API only accepts JSON for the data in requests to update cell values. If the sheet is being updated as expected I would think your request is working, but something in how your version of cURL is handling the response data isn't working.

Have you tried making the request using a REST Client like Postman to see if the error persists? This would help differentiate if this is due to some issue with your installation of cURL or not.

In reply to by dAVE Inden

The changes are happening on my sheet. however, I need to programaticaly acknowledge the success/failure response. However, the response is not a formatted JSON. I

t works well with Advanced Rest Client. However, when I am using same request through C# REST API the response contentstring is merged with HTTP response headers.

All other API except the Update row, like for Create Sheet/Add row/ Delete row are returning a formatted json response with correct response headers. I am using a common method to make request and read response by passing the different request URL to the method.

Response.Header is : HTTP/1.1 100 Continue 

Response.Chunked = false;

Response.ContentString is as below:

HTTP/1.1 200 OK

Date: Mon, 06 May 2019 05:35:01 GMT

Cache-Control: no-cache, no-store, must-revalidate

Pragma: no-cache

Expires: 0

Content-Type: application/json;charset=UTF-8

Content-Length: 556

Vary: Accept-Encoding

{"message":"SUCCESS","resultCode":0,"result":[.....]}

In reply to by pchadha

Aha, I see. The Smartsheet API sends all responses back as JSON. This issue sounds like it is on the client making the request to update the rows and how the response is handled. Have you looked into what code you have written to make the requests and see how it might be different in some cases?

I would strongly suggest using our SDK as it handles all of this for making requests to the Smartsheet API.

In reply to by dAVE Inden

Will the libraries be compatible for WINCE platform?

for now I am not able to test them on my device due to some signing issues. I can request the key once I know framework compatibility.

In reply to by pchadha

We don't specifically have support for Windows CE. Though we do have it on our roadmap to add support for .NET Core this year and that may help you. What is the use case where you need to work with Windows CE? What kind of devices are you building for?

I would also suggest taking a look into methods of deserializing JSON with your framework to see how you can handle the response coming back from our API.