curl https://directline.botframework.com/v3/directline/conversations \
-H "Authorization: Bearer <DIRECT_LINE_SECRET_KEY>" \
-X POST
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
| using System; | |
| using System.IdentityModel.Tokens.Jwt; | |
| using Microsoft.IdentityModel.Tokens; | |
| using System.Text; | |
| public class JwtTokenGenerator | |
| { | |
| public string CreateZendeskJwtToken(string zendeskSecret, string keyId, string userName, string userEmail, string externalId) | |
| { | |
| var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(zendeskSecret)); |
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
| using System; | |
| using System.IdentityModel.Tokens.Jwt; | |
| using System.Security.Claims; | |
| using System.Text; | |
| using Microsoft.IdentityModel.Tokens; | |
| public class JwtTokenGenerator | |
| { | |
| public string CreateZendeskJwtToken(string zendeskSecret, string userId, string userName) | |
| { |
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
| openapi: 3.0.0 | |
| info: | |
| title: Your API | |
| version: 1.0.0 | |
| servers: | |
| - url: https://yourapi.com | |
| security: | |
| - BearerAuth: [] | |
| components: | |
| securitySchemes: |
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
| const express = require('express'); | |
| const jwt = require('jsonwebtoken'); | |
| const app = express(); | |
| const PORT = 3000; | |
| const SHARED_SECRET = ''; | |
| const ZENDESK_SUBDOMAIN = ''; | |
| app.get('/test', (req, res) => { |
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
| function getRandomNumber(cb) { | |
| setTimeout(() => cb(random()), random()); | |
| } | |
| function random() { | |
| return Math.round(Math.random() * 1000); | |
| } | |
| // generate an array of 64 random numbers using the getRandomNumber function. Each elment in the array must be guaranteed unique. |
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
| (export const (.*) = (\w|\s)*\((\n|\s|\w|:|,|<|>)*\):.*=> \{\n) | |
| $1 console.log('$2')\n |
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 = '<BotUserOAuthAccessToken>' | |
| const paths = { | |
| list: `https://slack.com/api/conversations.list?token=${token}&exclude_archived=true`, | |
| archive: `https://slack.com/api/conversations.archive?token=${token}&channel=`, | |
| join: `https://slack.com/api/conversations.join?token=${token}&channel=` | |
| } | |
| const log = tag => v => { |
- Node dev environment
- Sunco v2 and Switchboard access
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
| const axios = require('axios'); | |
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const APP_ID = ''; | |
| const KEY_ID = ''; | |
| const SECRET = ''; | |
| const author = { | |
| role: 'appMaker', |
NewerOlder