【发布时间】:2022-01-13 06:07:26
【问题描述】:
我在 Zapier 开发者平台中创建了一个自定义操作。我的任务是将 Xero 会计软件中的 PDF 文件加载到 Zapier 中,以便我可以在我的 zap 中使用它来附加到电子邮件。
到目前为止,我有下面的代码返回成功的响应,但不幸的是 PDF 文件总是空白:
const pdfURL = {
url: 'https://api.xero.com/api.xro/2.0/Quotes/' + bundle.inputData.QuoteID,
method: 'GET',
headers: {
'Accept': 'application/pdf',
'Authorization': `Bearer ${bundle.authData.access_token}`,
'Xero-tenant-id': bundle.inputData.TenantID
}
};
const fileRequest = await z.request(pdfURL);
const url = await z.stashFile(fileRequest); // knownLength and filename will be sniffed from the request. contentType will be binary/octet-stream
return {url};
有什么想法可能是错的吗?
提前致谢。
【问题讨论】:
标签: zapier zapier-cli