1. Open your Google Doc → click Extensions → Apps Script.
2. Paste this code into the editor:
function doPost(e) {
var data = JSON.parse(e.postData.contents);
var doc = DocumentApp.getActiveDocument();
doc.getBody().setText(data.content);
return ContentService.createTextOutput(JSON.stringify({ status: "success" })).setMimeType(ContentService.MimeType.JSON);
}
3. Click Deploy → New deployment → gear icon → Web app.
4. Set Execute as: Me and Who has access: Anyone.
5. Click Deploy, authorize access, and copy the Web app URL into the box above!