Created
November 11, 2022 02:12
-
-
Save roundrop/e46674806184d7da8e9a81b3e2a3826c to your computer and use it in GitHub Desktop.
App Script that receives webhook requests and records them in a Google Spreadsheet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doPost(e) { | |
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; | |
sheet.getRange("1:1").insertCells(SpreadsheetApp.Dimension.ROWS); | |
sheet.getRange(1, 1).setValue((new Date).toLocaleString('ja-JP')); | |
sheet.getRange(1, 2).setValue(e.postData.contents); | |
// send 200 OK status back to confirm receiving webhook | |
var response = HtmlService.createHtmlOutput(); | |
return response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment