Skip to content

Instantly share code, notes, and snippets.

View JordanSchuetz's full-sized avatar
😍
Coding

Jordan Schuetz JordanSchuetz

😍
Coding
View GitHub Profile
export default (request, response) => {
const pubnub = require('pubnub');
const xhr = require('xhr');
const db = require("kvstore");
console.log('request',request);
//extract from typeform
const tf_data = JSON.parse(request.body);
console.log('tf_data', tf_data)
const { answers } = tf_data.form_response;
export default (request, response) => {
const kvstore = require('kvstore');
const xhr = require('xhr');
const PubNub = require("pubnub");
let pubnub = new PubNub({
publishKey: 'demo',
subscribeKey: 'demo'
});
let bodyString = request.body;
@JordanSchuetz
JordanSchuetz / library.raml
Last active June 24, 2020 22:39
library.raml file
#%RAML 1.0 Library
usage:
types:
Text: !include dataTypes/dataType.raml
resourceTypes:
text:
post:
description: This API will send a secure text message with Twilio to the phone number you input
body: Text
responses:
#%RAML 1.0 DataType
properties:
ToPhoneNumber:
description: Enter the mobile number to send a text
example: 15553334444
type: integer
required: true
Message:
description: Enter your message
example: Text message body
mediaType: application/json
uses:
library: library.raml
/text:
type: library.text
#%RAML 1.0 DataType
properties:
ToPhoneNumber:
description: Enter the mobile number to send a text
example: 15553334444
type: integer
required: true
Message:
description: Enter your message
example: Text message body
@JordanSchuetz
JordanSchuetz / root-copy-paste.raml
Created June 27, 2020 21:33
Add this script to your root raml file
mediaType: application/json
uses:
library: library.raml
/text:
type: library.text
#%RAML 1.0 SecurityScheme
type: Basic Authentication
describedBy:
headers:
client_id:
type: string
client_secret:
type: string
responses:
401:
@JordanSchuetz
JordanSchuetz / securityScheme-add-text.raml
Created June 27, 2020 21:49
Add this text to your secuityScheme.raml file
securitySchemes:
clientIDrequired: !include securityScheme.raml
securedBy:
- library.clientIDrequired