To verify a webhook i need to get a parameter from the request headers. So far i couldn't find any information if it is actually possible to access these headers within Apps Scripts. Only thing that works so far is accessing the body of the post request.
function doPost(e) {
// something like this
var headerParam = e.headers['Content-Type'];
// ...
}
Unfortunately this is not currently possible with doPost()
triggers. However there is a pending feature request for this issue on Google's issue tracker. If you'd like to see this feature supported please leave a comment (on the issue thread linked below) and be sure to STAR the issue at the following link:
https://issuetracker.google.com/issues/67764685
The workaround I currently use is to leverage Google Cloud Functions. I wrote a related article about it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With