APIs & Integrations

thecoolcoder
Member

Hubspot + Google Drive via Zapier: Some files won't upload to Drive due to Hubspot permisisons, using connector

I'm pulling friendly URL from COS API for CRM files. I pass them to a webhook that catches them and passes them to Google Drive upload feature in Zapier. Some files transfer perfectly, but some files give me a 403 error. The Google Drive is bound inside of Zapier to the target Google Drive account. Again, it works for most files. I get both PDFs and JPGs to come over fine. When I get a 403 error, I cannot view the CRM Engagement/Attachment file in the COS. It gives the same 403 error (forbidden).

I have read on scoping and such, but the connector in Zapier that binds to Google Drive should negotiate all of that I would think - plus, it works a great deal of the time.

Help!?

0 Upvotes
3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hubspot + Google Drive via Zapier: Some files won't upload to Drive due to Hubspot permisisons, using connector

Hi @thecoolcoder,

Thanks for passing along this info! So it's definitely related to the way these files were initially uploaded; for files that were uploaded in-app as attachments to an object record, HubSpot automatically sets the hidden flag in order to prevent them from being visible externally/in the file manager. For the files that you've uploaded and attached yourself (via the API) it doesn't appear you've set the hidden flag, so they're still visible externally. This is actually intentional, since the separation of attached files and file manager files in app is by design.

This means that it's not possible for files attached to object records in-app to be accessed by this Google Drive integration; I'd recommend uploading them to the file manager and attaching them via a note if the files need to be accessed by this integration.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hubspot + Google Drive via Zapier: Some files won't upload to Drive due to Hubspot permisisons, using connector

Hi @thecoolcoder,

Can you give me your Hub ID and an example file that did not / does not work correctly?

0 Upvotes
thecoolcoder
Member

Hubspot + Google Drive via Zapier: Some files won't upload to Drive due to Hubspot permisisons, using connector

Derek,

First, thank you ever so much for this. I appreciate your help here - very much.

Files that are attachments to deals. Some are viewable and some are not by the friendly URL value in the COS API.

FAIL (403 unless I use preview took in CRM. I may have selected these files form existing folders in the COS file manager)

https://cdn2.hubspot.net/hubfs/4294839/Michael Russo 2.6kW Panel Layout.jpg (fail)

https://cdn2.hubspot.net/hubfs/4294839/WardHomeLocation.jpg (fail)

WORKS (I uploaded these as a note with an attachment and manually uploaded it at that time.)

https://cdn2.hubspot.net/hubfs/4294839/Sales Library/Case Studies/10kW Solaray System The Key Numbers.pdf (works)

https://cdn2.hubspot.net/hubfs/4294839/SolarayEnergy -Mar2018/Images/Logo.png (works)

I can only assume that it is the manner in which each file is uploaded. Such as an email attachment file it make sense to maybe lock it from public or anonymous viewing. It seems as though it needs the CRM file "Preview" tool to see some of these files. THAT is what prevents Google Drive from being able to pull the file via URL. Google Drive gets a 403 error for some files and some it does not. I get a 403 error when I view a url whether I am logged in or not for the files that are not working.

Portal ID: 4294839

Very appreciative for this attention.

0 Upvotes