I am having trouble validating my endpoint, which is a Google Apps Script.
Endpoint Google Apps Script code
const sT = "XXXXXXXXXXX"
function doPost(e) {
const requestMessage = e.postData.contents;
const requestJSON = JSON.parse(requestMessage)
const pT = requestJSON.payload.plainToken
var signature = Utilities.computeHmacSha256Signature(pT, sT, Utilities.Charset.US_ASCII);
var hexString = signature
.map(function (byte) {
// Convert from 2's compliment
var v = (byte < 0) ? 256 + byte : byte;
// Convert byte to hexadecimal
return ("0" + v.toString(16)).slice(-2);
})
.join("");
const response = {
plainToken: pT,
encryptedToken: hexString
}
return JSON.stringify(response)
}
The validation always fails. I have tried several formats for the return function. Not sure what is wrong, and there is not explicit example I can find.
But the issue is google script needs a pre-flight request with the 302 Found redirect and that is the actual issue from the (Client Side/App Validate Button) webhook validation with the google script endpoints.
For reference attaching both screenshots of the Google Script API response
@freelancer.nak Thank you for the all checkups. I understand that the problem is google apps script response. It is impossible to change the google apps script response, so the solution is having a new node.js server for the zoom webhooks. Is it right?
@freelancer.nak@elisa.zoom@donte.zoom
Thank you for your replies.
I gave up doing by Google Apps Script, and I am making a node.js server. It is working.(endpoint verification part has been done).
I am trying the same.
Any suggestions from the Zoom team on what to do here ?
Or are we saying tools like google appscript which expect a 302 redirect will not work with zoom webhooks ?