These are steps I took to get it up and running to no avail:
Created a Slack account
Used the example code for testing:
var Slack = require('slack-node');
webhookUri = "__uri___";
slack = new Slack();
slack.setWebhook(webhookUri);
slack.webhook({
channel: "#general",
username: "webhookbot",
text: "This is posted to #general and comes from a bot named webhookbot."
}, function(err, response) {
console.log(response);
});
3. Used the URL "https://mykoo.slack.com" as the value for webhook uri
4. ran node file.js
I get a response back (200) in the terminal:
\n\t\n\t\n\tToo many login failures! \n\tApologies! There were too many SMS message requests in a short period, so you’ll have to wait a moment to try again.\n\t
\n
\n\t Hmmm... something went wrong. Please try again.
\n\n\t\n
\n\t
\n\tSign in to mykoo\n\t
\n\n\t
mykoo.slack.com
\n\n\t\n\t
\n\t\t\n\t\t
\n\n \t\t
or
\n\n\t\t\t
Long password? Hard to type? We can email you a magic link so you can sign in without having to type your password.
\n\n\t\t\t\n\n\t\t
\n\n\n\t
\n\n\t
\n\t\t\t
\n
\n\t\n
\n\t\t\t
\n\t\t\tDon\'t have an account on this workspace yet?\n\t\t\tContact the workspace administrator for an invitation\n\t\t
Dumb issue. uri is obtained by making a slack app through their website and then following the steps. Might be good if this step was mentioned in the documentation.
These are steps I took to get it up and running to no avail:
webhookUri = "__uri___";
slack = new Slack(); slack.setWebhook(webhookUri);
slack.webhook({ channel: "#general", username: "webhookbot", text: "This is posted to #general and comes from a bot named webhookbot." }, function(err, response) { console.log(response); });
{ status: 'fail', statusCode: 200, headers: { 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', date: 'Wed, 11 Jul 2018 13:42:05 GMT', server: 'Apache', expires: 'Mon, 26 Jul 1997 05:00:00 GMT', vary: 'Accept-Encoding', pragma: 'no-cache', 'cache-control': 'private, no-cache, no-store, must-revalidate', 'x-robots-tag': 'noindex,nofollow', 'x-slack-backend': 'h', 'referrer-policy': 'no-referrer', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-xss-protection': '0', 'set-cookie': [ 'b=bth534vl8ug4cs8wwwwgg84w4; expires=Tue, 11-Jul-2028 13:42:05 GMT; Max-Age=315619200; path=/; domain=.slack.com' ], 'x-frame-options': 'SAMEORIGIN', 'x-via': 'haproxy-www-ym1d', 'x-cache': 'Miss from cloudfront', via: '1.1 5d2f8f11fd4049dfdd659b9554b801de.cloudfront.net (CloudFront)', 'x-amz-cf-id': 'hODpdQtsfDyx2B1A3rVDjNt5rJ4jnxdUsKjTE1dYlAjpLMLgtdMGDQ==' }, response: '\n\n\n<!DOCTYPE html>\n\n\n
\n\n\t\n\t\n\n \n\n\t\n\t\t\n\n\n\t\t\n\t\t\n\t\n\n\n\n\t\n\n\t\t\t\n\t\n\t\t\n\t\n\n\t\t\n\n\t\n\n\t\n\n\t\n\t\t\n\n\t\n\n\n\n\n\n\t\n\t\n\t\n\t\n\tToo many login failures!
\n\n\tApologies! There were too many SMS message requests in a short period, so you’ll have to wait a moment to try again.\n\t
\n\t Hmmm... something went wrong. Please try again.
\n\tSign in to mykoo\n\t
\n\n\tmykoo.slack.com
\n\n\t\n\t \n\n\t\n\t\t\t
\n\n\t\t\tDon\'t have an account on this workspace yet?\n\t\t\tContact the workspace administrator for an invitation\n\t\t
\n\t\n\t\n\t\t\t\n\t\t\tTrying to create a workspace?\t\t\t\n\t\n\tCreate a new workspace\n\t\t\t
\n\t