This works okay:
$Headers = @{
Authorization = "Bearer ***********"
}
$uri = "https://api.smartsheet.com/2.0/sheets/5034086415787908/rows"
$body = '[{"id": "5257700085983108", "cells": [{"columnId": "853109098473348","value": true}]}]'
Invoke-RestMethod -Method put -Uri $uri -Headers $headers -body $body
But this doesn't work:
$rowid = "5257700085983108"
$body = '[{"id": $rowid, "cells": [{"columnId": "853109098473348","value": true}]}]'
Error:
Invoke-RestMethod : {
"errorCode" : 1008,
"message" : "Unable to parse request. The following error occurred: Field \"null\" was not parsable. Unrecognized token '$rowid': was expecting ('true', 'false' or 'null')\n
How do I pass a variable in the body of the API?
Thanks.