How to view data coming from webhook

96 views
Skip to first unread message

Gaby Burkard (she/her)

unread,
Oct 4, 2021, 4:54:12 PM10/4/21
to Google Apps Script Community

Hello! There is an issue with the data coming into my apps script web app but I don’t understand how to view it.

This is basically what I have: 

function doPost(e){

   console.log(e.postData.contents)

}

I have the script attached to a standard GCP project but I don’t see anything in the logs there.


Thanks for your help!

David Gentile

unread,
Oct 5, 2021, 3:49:06 PM10/5/21
to Google Apps Script Community
I've had this issue before.

I believe the root cause is that in order for the webhook to work properly you have to set the permissions to allow anonymous users. So when the webhook comes in, it acts like its own user interacting with the script. What this means is that you're unable to view the logs because (I believe) you can only view logs related to your own user session.

Regardless, my method around it is to log all the incoming data to a Google Sheet. Set up a dedicated "Log" sheet, and then append the incoming data to that sheet for each request. I also add a timestamp for easy reference.

Hope that helps!

Reply all
Reply to author
Forward
0 new messages