How do I create a doPost(e) function in Apps Script project to capture HTTP POST data from web service?

前端 未结 3 772
挽巷
挽巷 2020-12-07 02:53

I\'m trying to create a script to capture data via HTTP POST from Ejunkie. When someone makes a purchase on ejunkie, they can transmit all the order data via HTTP POST to a

3条回答
  •  庸人自扰
    2020-12-07 03:16

    Instead of using Logger.log() as a way to notify yourself if your calls made it through, try sending an email to yourself instead. This is the snippet:

    function doPost(e) {
      if(typeof e !== 'undefined')
    
      MailApp.sendEmail({
         to: "youremail@gmail.com",
         subject: "Call Sucessful",
         htmlBody: "I am your 
    " + "DATA" }); }

    Just allow the necessary permission if asked. If I'm not mistaken Logger.log is for script editor only and not for your production web apps.

提交回复
热议问题