Yes, you can trigger an Apps Script function with an HTTPS POST request. You'll need to add a
doPost() function to a script file. The
doPost() function can also receive data from the POST request. If you want to receive data into the
doPost() function, add a variable name inside of the parenthesis:
// . . code here . .
The documentation typically shows a variable named
e inside of the parenthesis, but you can use any name that you want.
If you need to send a POST request from an Apps Script function, you can use:
The default type of request is a GET request, so you will need to use advanced options, and explicitly designate a POST request.
Google Apps Script Documentation - UrlFetchApp.fetch()
In order for the Apps Script project to be available, it must be published. In the script editor, click the "Publish" menu, and choose "Deploy as Web App". There are two versions of a Web App, the development version, and the "production" version. The development version has "dev" on the end of the URL. The production version has "exec" on the end of the URL.
The "exec" version of the Apps Script URL is what you must use for the URL in your POST request to your Apps Script project.
If you want to return something from the Apps Script web app, then you must use Content Service.
You can get more information from the following Stack Overflow post:
Call a custom GAS function from an external URL