Created
January 25, 2024 19:48
-
-
Save cfjedimaster/26f076547cde54427325e7a0bdded5af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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