Skip to content

Instantly share code, notes, and snippets.

@jhershauer
Created October 22, 2017 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhershauer/96c1c07a713699814d5074aa69134ae0 to your computer and use it in GitHub Desktop.
Save jhershauer/96c1c07a713699814d5074aa69134ae0 to your computer and use it in GitHub Desktop.
Call Ryver Webhook from Google Apps Script
function sendToRyver_(url,payload) {
var options = {
"method" : "post",
"contentType" : "application/json",
"payload" : JSON.stringify(payload)
};
return UrlFetchApp.fetch(url, options)
}
function callWebhook(e) {
//Note: You need to substitute your Ryver webhook URL here
var url = "https://example.ryver.com/application/webhook/8xtO4GzWw8PQGAI";
//Note: You can use markdown to format your chat/post/task body text
var body = "**Product:** " + e.values[1] +
"\n**Supports Webhooks:** " + e.values[2] +
"\n**Integrate How?:** " + e.values[3];
var payload = {
"subject" : "Integration Request: " + e.values[1], // Note: No subject if it is a chat webhook
"body" : body,
}
sendToRyver_(url,payload)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment