Is it possible to upload or link a file to the attachment section of a company using the API. We have several attached files in our other CRM that I’m trying to transfer over.
curl -v -X POST -H "Content-Type: application/json" -A "SearchSpring HubSpot API" -d '{"engagement":{"active":true,"ownerId":null,"type":"NOTE","timestamp":1469116690000},"associations":{"contactIds":[29280],"attachments":[{"id":4241968539}]},"metadata":{"body":"<strong>IMPORTED FROM NUTSHELL<\/strong>"}}' https://api.hubapi.com/engagements/v1/engagements?hapikey=my-api-key
The response I’m getting does not have the attachments array:
{"engagement":{"id":131442414,"portalId":492396,"active":true,"createdAt":1469118333628,"lastUpdated":1469118333628,"ownerId":0,"type":"NOTE","timestamp":1469116690000},"associations":{"contactIds":[29280],"companyIds":[],"dealIds":[],"ownerIds":[],"workflowIds":[]},"metadata":{"body":"<strong>IMPORTED FROM NUTSHELL</strong>"}}
You can only add attachments to an engagement with the parameter type:NOTE. If the engagement is a note you should get an attachments array in the response even if the engagement doesn’t have an attachment.
@seb_fairchild I can’t seem to get this to work, are you sure that’s the right format for the attachments? I don’t see an attachments property returned in the associations after adding the engagement.