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 help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives