Skip to content

Instantly share code, notes, and snippets.

View cfjedimaster's full-sized avatar
😺
Happy, and tired.

Raymond Camden cfjedimaster

😺
Happy, and tired.
View GitHub Profile
export let tests = {
good:[],
bad:[]
}
tests.good.push(`Hello All!
Thank you all for joining us today, we hope you enjoyed the workshop! For anyone that wasn't able to make it of would like to refer back this link will take you to a recording of the event:
https://drive.google.com/file/d/1h1IH7ns-3ywxi00Y6cDl_TpYG7v6Y2gF/view?usp=sharing
{
"assetID": "urn:aaid:AS:UE1:23c30ee0-2c4d-46d6-87f2-087832fca718",
"documentLanguage": "en-US"
}
{
"type":"CALLBACK",
"data": {
"url":"your webhook url",
"headers": {
"name":"value"
}
}
}
{
"assetID": "urn:aaid:AS:UE1:23c30ee0-2c4d-46d6-87f2-087832fca718",
"documentLanguage": "en-US",
"notifiers": [
{
"type": "CALLBACK",
"data": {
"url": "https://dummy.callback.org/"
}
}
async function createPDFJob(asset, webhook, token, clientId) {
let body = {
'assetID': asset.assetID,
'documentLanguage': 'en-US',
'notifiers': [
{
'type':'CALLBACK',
'data':{
'url':webhook
/*
Used to debug webhook notifications.
Will need to be used with ngrok.
Thanks to Todd Sharp for the base code I modified.
*/
import * as http from 'http';
async function handler(req, res) {
console.log('Entered webhook handler.');
{
"ack":"done"
}
{
"jobID": "FAQjIUIGfuIkgcBMMunRsZ56P6qoQ4bR",
"statusResponse": {
"status": "done",
"asset": {
"metadata": {
"type": "application/pdf",
"size": 79120
},
"downloadUri": "very long and very special unique url. so special",
{
"type":"CALLBACK",
"data": {
"url":"your webhook url",
"headers": {
"name":"value"
}
}
}
{
"type":"CALLBACK",
"data": {
"url":"your webhook url",
"headers": {
"cats":"rule",
"dogs":"drool"
}
}
}