Closed danshapir closed 7 months ago
@danshapir Thanks for the report! To handle this, you will specify {responseType: 'arraybuffer'}
during the call itself. An example of this is shown in the Quickstart:
https://github.com/plaid/quickstart/blob/master/node/index.js#L437
const pdfResponse = await client.assetReportPdfGet(pdfRequest, {
responseType: 'arraybuffer',
});
@phoenixy1 I'm talking about the statements end point, it doesn't support an extra parameter (at least according to TypeScript).
@danshapir This same pattern is used in the Statements Quickstart and results in a non-corrupted PDF:
https://github.com/plaid/quickstart/blob/master/node/index.js#L460
const statementsDownloadResponse = await client.statementsDownload(pdfRequest, {
responseType: 'arraybuffer',
});
Calling the statementsDownload api will result in a corrupted PDF as you aren't adding:
As part of the axios config, but returning a binary.