Telegram:
https://telegram.me/{TELEGRAM_BOT_NAME}?start={SMOOCH_APPUSER_ID}
Viber:
viber://pa?chatURI={VIBER_URI}&context={SMOOCH_APPUSER_ID}
Messenger:
http://m.me/{FB_PAGE_ID}?ref={SMOOCH_APPUSER_ID}
| /* | |
| Smooch's POST message endpoint accepts a flat JSON property called metadata. | |
| It provides developers with the opportunity to pass additional information with the message. | |
| By default, the metadata property is not rendered in Smooch's messaging channels. | |
| See https://docs.smooch.io/rest/#post-message for more information. | |
| Here we'll show an example of using message metadata with the intention of passing a link to a video along with a message. | |
| A developer may then extend a client, like Smooch's Web or native mobile SDKs, to render the video in the chat. | |
| We will not cover the rendering of the video here. | |
| */ | 
| /* | |
| Smooch link code generation requests have the following structure: | |
| GET https://api.smooch.io/v1/appusers/[APPUSER_ID]/transferrequest?type=[CHANNEL_NAME] | |
| The response contains the following JSON: | |
| { | |
| "transferRequests": [{ | |
| "type": "CHANNEL_NAME", | 
| const Smooch = require('smooch-core'); | |
| const ACCOUNT_KEY_ID = 'your_smooch_account_key_id'; | |
| const ACCOUNT_SECRET = 'your_smooch_account_secret'; | |
| const APP_ID = 'your_smooch_app_id'; | |
| const CONSUMER_KEY = 'your_twitter_consumer_key'; | |
| const CONSUMER_SECRET = 'your_twitter_consumer_secret'; | |
| const ACCESS_TOKEN_KEY = 'your_twitter_access_token'; | |
| const ACCESS_TOKEN_SECRET = 'your_twitter_access_token_secret'; | 
Telegram:
https://telegram.me/{TELEGRAM_BOT_NAME}?start={SMOOCH_APPUSER_ID}
Viber:
viber://pa?chatURI={VIBER_URI}&context={SMOOCH_APPUSER_ID}
Messenger:
http://m.me/{FB_PAGE_ID}?ref={SMOOCH_APPUSER_ID}
| const qs = require('qs'); | |
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const superagent = require('superagent'); | |
| const AUTHOR_ID = ''; // Zendesk user id for the user who will post notes, e.g. "517393059" | |
| const USERNAME = ''; // username for the Zendesk user who authorizes API access, e.g "stasi@smooch.io" | |
| const PASSWORD = ''; // password for the Zendesk user who authorizes API access, e.g. "princess" | |
| const SUBDOMAIN = ''; // Zendesk subdomain, e.g. "stasicorp" | 
| const twilioAccountSid = ''; | |
| const twilioAuthToken = ''; | |
| const twilioPhonenumberSid = ''; | |
| const smoochAccountKeyId = ''; | |
| const smoochAccountSecret = ''; | |
| const smoochAppId = ''; | |
| const Smooch = require('smooch-core'); | |
| const smooch = new Smooch({ | 
| const catPut = document.getElementById('cat-input'); | |
| const catList = document.getElementById('cat-list'); | |
| document.getElementById('cat-button').onclick = () => { | |
| const cat = catPut.value; | |
| superagent.post('/cats').send({ cat }).end((err, res) => { | |
| err ? alert(err.message) : catPut.value = ''; | |
| }); | |
| } | 
| const authToken = require('jsonwebtoken').sign({ scope: 'account' }, 'your_secret_key', { | |
| header: { | |
| typ: 'JWT', | |
| kid: 'your_key_id', | |
| alg: 'HS256' | |
| } | |
| }); | 
| const fs = require('fs'); | |
| const PATH = process.argv[2] || __dirname; | |
| const LEVEL = parseInt(process.argv[3] || 1); | |
| const TARGET = process.argv[4]; | |
| const DELETE = process.argv[5]; | |
| fs.readdirSync(PATH) | |
| .filter(isOptionalTarget) | |
| .filter(isMarkdownFile) | 
| def qs(compare, items): | |
| if len(items) < 2: return items | |
| pivot = items[0] | |
| left = [] | |
| right = [] | |
| for item in items[1:]: | |
| if compare(pivot, item): left.append(item) | |
| else: right.append(item) |