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
{
"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"
}
}
}
async function createPDFJob(asset, webhook, token, clientId) {
let body = {
'assetID': asset.assetID,
'documentLanguage': 'en-US',
'notifiers': [
{
'type':'CALLBACK',
'data':{
'url':webhook,