Skip to main content

Hi, I have a multi-step Zap that is firstly creates a Xero purchase order from a new Xero sales invoice.  So far so god.
 

But I need to then email that purchase order.

I’ve tried pdf.co to HTML to pdf and it was too complex for me to work out.

I tried using a Google Doc template so I could then pdf that and email it.  I can’t figure out how to add the purchase order lines into the google doc.  Each purchase order line component populates all results in single fields.

I thought I’d cracked it when I added Xero upload attachment but I get an Authorisation Error when I go to email the file.

I would be grateful for some advice as to how to get this working via any method in Zapier.  Thank you.

Hi @Lou-nz 

Help link for using files in Zaps: https://zapier.com/help/create/basics/send-files-in-zaps

 

From the Xero API docs:

 

Zap action: Xero - API Request

 

For us to have more info, post these screenshots:

  • how your Zap steps are outlined and configured in EDIT mode
  • errors encountered when testing Zap steps

Thanks for your speedy reply @Troy Tessalone 

I don't really understand the Xero dev documentation.

If I focus on the Xero attachment side I receive an Authenication Unsuccessful error.

1st step, create the purchase order is working well.

Next, find the purchase order from the previous step
 



Next upload the attachment
 




Here is the pdf file link I get when I upload the purchase order user Upload Attachment action

https://api.xero.com/api.xro/2.0/PurchaseOrders/7332768f-3e77-4a02-b95a-688b89a044fc/Attachments/7332768f-3e77-4a02-b95a-688b89a044fc.pdf

 


So the email step won’t work, because it can’t access the file.

How do I make that upload attachment link accessable?

Or how do I get the pdf of the purchase order another way so that I can email it?

Thank you.


@Lou-nz

When you see a variable with (Exists but not shown) that is a file object, which is a temp version of the file that expires after 1 hour.

Make sure to retest Zap step 9 to get a fresh file before testing Zap step 10.

 

If you are trying to use file links, then those file links must be publicly accessible direct download links.


Hi @Troy Tessalone 

Edit screenshots and zap steps provided in my earlier reply?

The error is on the last email step, but it relates to the issue with the attachment link not having authorisation in the upload attachment step.

Is that not the info you’re after?  Apologies if this is not the edit screen I actually don’t know what is!
 

 


@Lou-nz

We would need to see screenshots with how your Zap step 11 is configured in EDIT mode for the “Configure” section.

 

If you are trying to use file links, then those file links must be publicly accessible direct download links.

 

When you see a variable with (Exists but not shown) that is a file object, which is a temp version of the file that expires after 1 hour.

Make sure to retest Zap step 9 to get a fresh file before testing Zap step 10.

 

 


@Lou-nz

When you see a variable with (Exists but not shown) that is a file object, which is a temp version of the file that expires after 1 hour.

Make sure to retest Zap step 9 to get a fresh file before testing Zap step 10.

 

If you are trying to use file links, then those file links must be publicly accessible direct download links.


Thanks @Troy Tessalone 

That is indeed the issue I cannot overcome. 

Even if I test the Find Purchase (step 9) and go straight to test Upload Attachment (Step 10), the link provided in that step

is not accessible.  If I can get that link accessible I’m away.
 

 


 


@Lou-nz 

If that does not work, then try one of these to hydrate a file.

 

Zap action: Xero - API Request

Method: GET

URL: Map this variable

OR

Other approach

 


Here’s the edit of step 11, with the URL in the attachment field.

 

 


Thanks again @Troy Tessalone 

I worked it out with the help of your GET recommendation.  I removed the Upload Attachment step and used the pdf file from the Find Purchase Order step.

 

It now emails the attachment.

 

Cheers,

 

 


That’s awesome @Lou-nz! A huge thanks to Troy for lending a hand and pointing you in the right direction!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗