Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created January 25, 2024 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfjedimaster/26f076547cde54427325e7a0bdded5af to your computer and use it in GitHub Desktop.
Save cfjedimaster/26f076547cde54427325e7a0bdded5af to your computer and use it in GitHub Desktop.
async function createPDFJob(asset, webhook, token, clientId) {
let body = {
'assetID': asset.assetID,
'documentLanguage': 'en-US',
'notifiers': [
{
'type':'CALLBACK',
'data':{
'url':webhook
}
}
]
};
body = JSON.stringify(body);
let req = await fetch(REST_API+'operation/createpdf', {
method:'post',
headers: {
'X-API-Key':clientId,
'Authorization':`Bearer ${token}`,
'Content-Type':'application/json'
},
body: body
});
return req.headers.get('location');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment