Question

Get PDF binary file with z.stashFile

  • 6 January 2024
  • 2 replies
  • 42 views

Badge

Unable to add ‘await’. Get the editor error Missing “;” before statement. on line 16.
Without the await the code executes but the binary file arrives corrupted due to truncating. Why cant I add the await syntax to line 16?

const encodedToken = Buffer.from(bundle.authData.api_key, 'ascii').toString('base64');

const fileRequest = z.request({
url: 'https://app.useanvil.com/api/v1/generate-pdf',
raw: true,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Basic ${encodedToken}`
},
body: {
'data':bundle.inputData.template
}
});

const file = await z.stashFile(fileRequest);

return {file};

 


2 replies

Userlevel 7
Badge +14

Hi @amarunda 

If you are building a Zap app integration, then you should post your topic in the Developer Zone: https://community.zapier.com/p/developer-zone

Badge

ok noted

Reply