Google Apps Script – doPost() Request Not Received from Announcement Page

google-apps-script

I have to pass data of an announcement from App script to my spreadsheet using Google App script. I have created an announcement page and I have an app script attached to the Announcement page which is a simple doPost(). It looks like this:

function doPost(e) {
  Logger.log(JSON.stringify(e));
}

For the same page; doGet() returns a response. However, doPost() returns nothing. I am unable to understand that I am able to see the data of post request when I open up my developer's console but not in the parameter of doPost(). I have also logged this an Announcement page issue. If someone can guide through this I would be very grateful to you.

Best Answer

It wont work like this. We need to use Google's Announcement class to get the list of contents from announcements page. For more reference, please refer to this link: https://developers.google.com/apps-script/reference/sites/page