# Is it possible to use Google Apps Script as a webhook endpoint

**URL:** <https://devforum.zoom.us/t/is-it-possible-to-use-google-apps-script-as-a-webhook-endpoint/118378>\
**Category:** API and Webhooks\
**Tags:** webhooks\
**Created:** [September 30, 2024, 7:53pm UTC](https://devforum.zoom.us/t/is-it-possible-to-use-google-apps-script-as-a-webhook-endpoint/118378 "2024-09-30T19:53:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandro1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/alejandro1/32/50330_2.png) [@alejandro1](https://devforum.zoom.us/u/alejandro1)\
**Post date:** [September 30, 2024, 7:53pm UTC](https://devforum.zoom.us/t/is-it-possible-to-use-google-apps-script-as-a-webhook-endpoint/118378/1 "2024-09-30T19:53:14Z")

</div>

I’m trying to use Google Apps Script as an endpoint and i’m having trouble validating the link. I’m getting the error “URL validation failed. Try again later.” I found out that Content Service uses a redirect to serve the response, which apparently isn’t compatible with the Zoom webhook verification process.  
I researched this topic and all i could find were old threads on this topic from multiple forums where someone either says it’s impossible, gives up, or suggests using HtmlOutput to deliver the response without providing a working example. Is it possible? If so how can i use HtmlOutput to respond with JSON?  
Here is my current code for reference:

```auto
function doPost(e) {
  let token = "XXXXXXXXXXXXXX";
  let data = JSON.parse(e.postData.contents);
  let response = {}
  if(data.event=="endpoint.url_validation"){
    let plainToken = data.payload.plainToken
    let rawHash = Utilities.computeHmacSha256Signature(plainToken, token);
    let txtHash = '';
    for (let j = 0; j <rawHash.length; j++) {
      let hashVal = rawHash[j];
      if (hashVal < 0)
        hashVal += 256; 
      if (hashVal.toString(16).length == 1)
      txtHash += "0";
      txtHash += hashVal.toString(16);
      }
    response = {
      plainToken: plainToken,
      encryptedToken: txtHash
    };
  }
  return ContentService.createTextOutput(JSON.stringify(response)).setMimeType(ContentService.MimeType.JSON);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 4, 2025, 11:29am UTC](https://devforum.zoom.us/t/is-it-possible-to-use-google-apps-script-as-a-webhook-endpoint/118378/2 "2025-10-04T11:29:25Z")

</div>

Closed on October 4, 2025, 11:29am UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
