I'm trying to setup a simple flow of data being posted to a smartsheet via powershell post call, but having some trouble getting the POST query working and not sure what I missed or if what I'm trying to do, would require using the SDK instead.
I generate a json payload that matches the sheet columns , like so:
{
"toTop": true,
"rows": [
{
"cells": [
{
"columnId": 726263711092612,
"value": "data"
},
{
"columnId": 5229863338463108,
"value": "more data"
},
{
"columnId": 2978063524777860,
"value": "even more data"
},
...More similar sets...
I'm able to GET query the sheet fine and managed to confirm the columnIDs - the first column is the primary column.
When I attempt to send this payload on POSTMAN I get a success message, which is also registered in smartsheet as "Row Inserted", but the smartsheet remains empty.
server response
{
"message": "SUCCESS",
"resultCode": 0,
"version": 30,
"result": {
"id": <ID>,
"sheetId": <sheet ID>,
"rowNumber": 1,
"expanded": true,
"locked": false,
"lockedForUser": false,
"createdAt": "2025-01-02T13:47:57Z",
"modifiedAt": "2025-01-02T13:47:57Z",
"cells": [
{
"columnId": 726263711092612
},
all the column IDs are listed...
I assume this is something dead simple but I for one can't see it. So any help is greatly appreciated!
Cheers!
I'm trying to setup a simple flow of data being posted to a smartsheet via powershell post call, but having some trouble getting the POST query working and not sure what I missed or if what I'm trying to do, would require using the SDK instead.
I generate a json payload that matches the sheet columns , like so:
{
"toTop": true,
"rows": [
{
"cells": [
{
"columnId": 726263711092612,
"value": "data"
},
{
"columnId": 5229863338463108,
"value": "more data"
},
{
"columnId": 2978063524777860,
"value": "even more data"
},
...More similar sets...
I'm able to GET query the sheet fine and managed to confirm the columnIDs - the first column is the primary column.
When I attempt to send this payload on POSTMAN I get a success message, which is also registered in smartsheet as "Row Inserted", but the smartsheet remains empty.
server response
{
"message": "SUCCESS",
"resultCode": 0,
"version": 30,
"result": {
"id": <ID>,
"sheetId": <sheet ID>,
"rowNumber": 1,
"expanded": true,
"locked": false,
"lockedForUser": false,
"createdAt": "2025-01-02T13:47:57Z",
"modifiedAt": "2025-01-02T13:47:57Z",
"cells": [
{
"columnId": 726263711092612
},
all the column IDs are listed...
I assume this is something dead simple but I for one can't see it. So any help is greatly appreciated!
Cheers!
Ok the answer was really dumb. my json format was wrong.
when I removed:
"rows": [ {
stuff started to work... face palm