I'm having the same difficulty as user:itsallgood in this link--I get the following error when I submit the below request to add a row.
{"errorCode":1008,"message":"Unable to parse request. The following error occurred: Request body must be either a JSON object or JSON array."}
I believe the data is formatted correctly, and I have validated that it is valid JSON at jsonformatter.curiousconcept.com.
var params = {
"headers":{
"authorization":"Bearer <<removed for public posting>>"
},
"contentType":"application/json",
"method":"PUT",
"body":[
{
"toBottom":true,
"cells":[
{
"columnId":4209581015492484,
"value":"New row"
}
]
}
]
}
var response = UrlFetchApp.fetch("https://api.smartsheet.com/2.0/sheets/<<sheet key removed>>/rows", params)
The answer provided to itsallgood is that the problem is due to a bug with the API 1.1 endpoint and that 2.0 will solve it. However, I am using the API 2.0 endpoint and still getting the error.
If someone can help solve this riddle, I'll be much obliged!