Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save camrobert/4a40e5dfaf2ea27bc8a7c9c8f754f6d9 to your computer and use it in GitHub Desktop.
Save camrobert/4a40e5dfaf2ea27bc8a7c9c8f754f6d9 to your computer and use it in GitHub Desktop.
<script runat="server">
Platform.Load("Core","1");
try{
var url = 'https://hooks.slack.com/services/xxxxxxxx/yyyyyyyyyyyy/zzzzzzzzzzzzzzzz';
var contentType = 'text/plain';
var payload = '{"text":"Now this is SSJS!"}';
var headerNames = [];
var headerValues = [];
var result = HTTP.Post(url, contentType, payload, headerNames, headerValues);
Write(result.StatusCode + '<br>');
Write(result.Response);
}
catch(error) {
Write('Message: '+ error);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment