APIs & Integrations

psjavi
Participant

Unable to infer object type from: files

SOLVE

Hi, I'm trying to create an association between a contact and a attached file via API integration using the package https://github.com/HubSpot/hubspot-api-php  but I'm having an error.

 

The response is the following:

 

Unable to infer object type from: files

I've done a test using directly Insomnina as following:

 

psjavi_0-1691135834559.png

 

What I'm doing wrong?

 

I've configured the following permissions for the private app:

psjavi_1-1691136018199.png

 

0 Upvotes
1 Accepted solution
coldrickjack
Solution
Guide

Unable to infer object type from: files

SOLVE

Hey @psjavi,

 

Files are associated to Contacts in the CRM using Engagements (Notes). When creating an engagement you can include the file ID by including it in the "hs_attachment_ids" attribute in your request. Once the engagement has been created you can then associate to the contact using to engagement using type "contact_to_note". 

 

 

View solution in original post

1 Reply 1
coldrickjack
Solution
Guide

Unable to infer object type from: files

SOLVE

Hey @psjavi,

 

Files are associated to Contacts in the CRM using Engagements (Notes). When creating an engagement you can include the file ID by including it in the "hs_attachment_ids" attribute in your request. Once the engagement has been created you can then associate to the contact using to engagement using type "contact_to_note".