I cannot get the PUT method to work. What is wrong with my Google Script code ?

I cannot get the PUT method to work. It does not error but it also does not update the sheet. The same code framework will add columns (with a POST), and pull back data (with a GET)..but it will not put data into the sheet.
Tried it with Content-Type in the Headers section and Options, with out single quotes and with,..all kinf\ds of variations but no good.
var headers3 = { "Authorization" : "Bearer " + basicToken, };
var url3 = 'https://api.smartsheet.com/2.0/sheets/' + googleSheetData1[x][0]+ '/rows' ;
var options3 = {
'method': "PUT",
'content-type':'application/json',
'headers': headers3,
'muteHttpExceptions' : true,
'payload': JSON.stringify([{"id":rowidx,"cells":[{"columnid":colidx,"value":"kevintest"}]}])
}
try{ var response3 = UrlFetchApp.fetch(encodeURI(url3),options3);
Answers
-
Hi @KTO!
I recommend using Postman to test your API calls. This way, you can verify whether the issue lies within the API call itself or your script code. It’s a good method to troubleshoot and pinpoint the problem more efficiently.
Please note that Smartsheet Support doesn’t handle inquiries related to custom scripts or coding issues.
In the meantime, here is our API Documentation which might be helpful. Also, if you don’t get a response from the community, I suggest checking out Stack Overflow where other developers using Smartsheet can provide insights.
I hope this helps!
Cheers,
Isaac.Need more information? 👀 |Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 |Global Discussions
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.7K Get Help
- 436 Global Discussions
- 152 Industry Talk
- 497 Announcements
- 5.3K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 77 Community Job Board
- 508 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 37 Webinars
- 7.3K Forum Archives