Question

GDrive attachment to custom Xero Attachment API

  • 19 December 2023
  • 2 replies
  • 35 views

Hey there,

 

I’ve currently got a process which works as follows:

  1. Trigger of a new file (pdf) in a GDrive folder
  2. Looks up filename in a GSheet to get an internal identifier for invoice ID
  3. Uses the invoice ID on the native Xero action to find it
  4. I want to then upload the attachment pdf to the existing invoice

I know that the native Xero integration does not support this so have used an API request webhook instead. This is successful aside from the fact that the attachment does not load / open in Xero.

I know that the native integration for creating a new invoice has the ability to upload an attachment as a “file” dimension. But am struggling to figure out how to do this with a custom API request.

I’ve read the potential to convert the pdf into “Bytes” and by pulling a GET request on an existing invoice with an attachment, I can see this process.

But any help is appreciated as to how best to proceed / if I need to convert the pdf to something for it to load appropriately.

Thanks!


2 replies

Update: I wonder if it is to do with the Content-Type header also. I see it defaults to text/xml but assume this should application/pdf if a pdf.

Userlevel 1
Badge

Hi @goodgoaj

Yes you will have to send file as application/pdf format. If this is not possible via Zapier then I suggest to give quik.run a try. It's a versatile tool from where you can create custom code snippets, and seamlessly integrate with Zapier to incorporate your snippets directly into your Zap workflows.

 

Please refer to this blog to know more about QuikRun. If you'd like further assistance or have any questions, feel free to connect with me at nparashar150@gmail.com or naman@quik.run. I'd be more than happy to help you get this up and running as soon as possible.

Reply