Hello,
I call the API from a Google App Script project with this kind of body:
function add_booking(body) { const app_id = 'XXX'; const access_key = 'V2-XXX'; const table_name = 'mytable'; const url = 'https://api.appsheet.com/api/v2/apps/' + app_id + '/tables/' + table_name + '/Action'; const headers = { 'applicationAccessKey':access_key }; const payload = { 'Action':'Add', 'Properties':{}, 'Rows':[ { 'name':'some data' } ] }; const options = { 'method': 'post', 'content-type': 'application/json', 'headers': headers, 'payload': JSON.stringify(payload) }; const response = UrlFetchApp.fetch(url,options); const status = response.getResponseCode(); Logger.log("RESPONSE_STATUS=" + status); }
I have a return code of 200 which is “success” according to the AppSheet documentation.
22:25:26 Infos RESPONSE_STATUS=200
However, no records are added to the targetted table.
The Audit Log tool shows two lines:
First line shows success with an error (??):
Properties: { "RestAPIVersion": 2, "TableName": "mytable", "AppTemplateVersion": "1.000091", "Errors": "'Action' is missing.", "AppTemplateName": "XXX", "Operation": "REST API invoke", "RecordType": "Stop", "Result": "Success", "ResultSuccess": true, "StatusCode": "OK" }
The seconde one shows the actual error:
REST API: { "Action": "'Action' is missing.", "Properties": {}, "Rows": [] } Properties: { "RestAPIVersion": 2, "TableName": "mytable", "AppTemplateVersion": "1.000091", "Errors": "'Action' is missing.", "AppTemplateName": "XXX", "Operation": "REST API invoke", "RecordType": "Start", "Result": "Failure" }
I have no clue of what happening here. The only thing i found is this item where a bug was found and fixed right away.
What can i do now?