This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <script src="https://cdn.smooch.io/smooch.min.js"></script> | |
| <script> | |
| Smooch.init({ | |
| appToken: 'your_app_token', | |
| emailCaptureEnabled: true | |
| }); | |
| </script> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| const jwt = require('jsonwebtoken'); | |
| const KEY_ID = 'your_key_id'; | |
| const SECRET = 'your_secret'; | |
| const body = { scope: 'app' }; | |
| const config = { | |
| header: { | |
| typ: 'JWT', | |
| kid: KEY_ID, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| const PORT = 8000; | |
| const express = require('express'); | |
| const parseJsonBody = require('body-parser').json(); | |
| const logRequestBody = (req, res) => { | |
| const prettyBody = JSON.stringify(req.body, null, 4); | |
| console.log(prettyBody); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| const jwt = require('jsonwebtoken'); | |
| const superagent = require('superagent'); | |
| const USER_ID = 'your_user_id'; | |
| const KEY_ID = 'your_key_id'; | |
| const SECRET = 'your_secret_key'; | |
| // Generate JWT | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| const request = require('request') | |
| const token = 'your_token' | |
| const paths = { | |
| list: `https://slack.com/api/channels.list?token=${token}&exclude_archived=1`, | |
| archive: `https://slack.com/api/channels.archive?token=${token}&channel=` | |
| } | |
| const listChannels = () => new Promise(function(resolve, reject) { | |
| request.get(paths.list, function(err, res, body) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import jwt # https://github.com/jpadilla/pyjwt | |
| import requests # http://docs.python-requests.org/en/master/ | |
| SECRET = 'your_secret' | |
| KID = 'your_key' | |
| token = jwt.encode({'scope': 'app'}, SECRET, algorithm='HS256', headers={'kid': KID, 'alg': 'HS256'}) | |
| response = requests.get(url="https://app.smooch.io/v1/webhooks", | |
| headers={'content-type': 'application/json', 'authorization': 'Bearer ' + token }, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'unirest' | |
| require 'jwt' | |
| SECRET = 'your_secret' | |
| KEY_ID = 'your_key' | |
| USER_ID = 'user_id' | |
| payload = { | |
| :scope => 'app' | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var jwt = require('jsonwebtoken'); | |
| var express = require('express'); | |
| var app = express(); | |
| var port = process.env.PORT || 3000; | |
| app.get('/', function(req, res) { | |
| var token = jwt.sign({ | |
| scope: 'app' | |
| }, | |
| req.query.secret, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var Smooch = require('smooch-core'); | |
| var request = require('request'); | |
| var jwt = require('jsonwebtoken'); | |
| var fs = require('fs'); | |
| var USER_ID = 'a_user_id'; | |
| var KEY_ID = 'your_key_id'; | |
| var SECRET = 'your_secret'; | |
| var token = jwt.sign({ | |
| scope: 'app' | |
| }, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| var express = require('express'); | |
| var app = express(); | |
| app.use('/public', express.static(__dirname + '/build')); | |
| app.get('/', function(req, res) { | |
| res.sendFile(__dirname + '/index.html'); |