Skip to content

Instantly share code, notes, and snippets.

@Sparragus
Created September 30, 2015 02:54
Show Gist options
  • Save Sparragus/e37e5f476a47dee97292 to your computer and use it in GitHub Desktop.
Save Sparragus/e37e5f476a47dee97292 to your computer and use it in GitHub Desktop.
slack-hello-world/index.js
// index.js
var request = require('request')
// Esta variable contiene el URL que Slack nos provee
var webhookURL = 'AQUI_PEGAS_LA_WEBHOOK_URL'
// Este es el mensaje que queremos enviar
var payload = {
text: 'Hello, World!'
}
// Aquí definimos las opciones para el request
var requestOptions = {
uri: webhookURL,
method: 'POST',
body: JSON.stringify(payload)
}
// Enviamos el request con nuestro mensaje
request(requestOptions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment