Uploaded November 2025 | Updated September 2026, 1 week ago
In today's video, I'll show you how to create a webhook in Slack so you can post messages to Slack from Google Apps Script.
***SLACK LINKS***
Create a new app: api.slack.com/apps
Message Formatting: https://docs.slack.dev/messaging/formatting-message-text
Block Kit Builder: app.slack.com/block-kit-builder
***** Sample Google Apps Script to Post Message to Slack *****
function sendMessageToSlack() {
let webhookURL = 'WEBHOOK_URL';
let name = 'Sheets Ninja';
let body = {
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": `Hey, Slack!\n\nThis is a test message.\n\nThanks ${name} for your contributions!`
}
}
]
}
let params = {
'method': 'POST',
'content-type': 'application/json',
'payload': JSON.stringify(body)
}
UrlFetchApp.fetch(webhookURL, params);
}
In today's video, I'll show you how to create a webhook in Slack so you can post messages to Slack from Google Apps Script.
***SLACK LINKS***
Create a new app: api.slack.com/apps
Message Formatting: https://docs.slack.dev/messaging/formatting-message-text
Block Kit Builder: app.slack.com/block-kit-builder
***** Sample Google Apps Script to Post Message to Slack *****
function sendMessageToSlack() {
let webhookURL = 'WEBHOOK_URL';
let name = 'Sheets Ninja';
let body = {
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": `Hey, Slack!\n\nThis is a test message.\n\nThanks ${name} for your contributions!`
}
}
]
}
let params = {
'method': 'POST',
'content-type': 'application/json',
'payload': JSON.stringify(body)
}
UrlFetchApp.fetch(webhookURL, params);
}










