Calling API from returns a 200 with no update on the sheet

I have a problem calling the API. It just returns 200 with no update to the table Parameters. We have an Apps Script that works perfectly fine with exactly the same data. It should trigger a job when Run_Flag is set to TRUE.

Can someone see what the problem is?

/K

const APP_ID = config.appId
const ACCESS_KEY = config.accessKey
const TABLE_NAME = 'Parameters'
const URL = 'https://api.appsheet.com/api/v2/apps/' + APP_ID + '/tables/' + TABLE_NAME + '/Action'

let data = {
  "Action": "Edit",
  "Properties": {
	"Locale": "en-US",
	"Location": "47.623098, -122.330184",
	"Timezone": "Pacific Standard Time",
	"UserSettings": {
	  "Period_To": "202106",
	  "Project": "20313-001"
	}
  },
  "Rows": [
	{
	  "Run_Flag": "TRUE",
	  "Project": "20313-001",
	  "Period_To": "202106",
	  "Type": "Final",
	  "Reporting_Level": "Project",
	  "Reporting_Template ": "Standard"
	}
  ]
}

console.log(`Executed appsheet report on ${URL}`)
const resp = await fetch(URL, {
	method: 'POST',
	headers: {
		'ApplicationAccessKey': ACCESS_KEY,
		'content-type': 'application/json',
		'Accept': 'application/json',
		'Accept-Charset': 'utf-8'
	},
	body: JSON.stringify(data)
})

// I just get 200 here. No change to the row
const json = await resp.text()

res.send({
	success: resp.status === 200,
	json,
});
0 2 291
2 REPLIES 2

What was the solution for you issue here?

Did anyone find a solution to this?

Top Labels in this Space