{"status":"error","message":"Invalid input JSON on line 1, column 129: Encountered START_ARRAY token for non-repeated field com.hubspot.engagements.base.Associations.deal_ids", correlation_Id:}
I suspect this is due to nested arrays set for associations.contactIds and associations.dealIds. Given your Contact and Deal ID variables are arrays themselves, try updating your associations object definition to:
Ya, I removed the nesting and now I am able to create engagements in more than one deal. Thanks.
One more quick question, can we update Clicks and Opens throught the engagement API endpoint and how to add attachments. The documentation mentioned about the File API to get the file ID, but the attachments are from external email. Can you suggest some resource to dig...
I don't think you'll be able to set the number of opens or clicks for this object type. The Engagement "Email" properties hs_email_click_count and hs_email_open_count are read-only (i.e. they are set automatically by HubSpot as part of the connected inbox feature).
And for attachments, yes, you'll need to use the Files API to make the files available in HubSpot (either via import from a public URL or local file upload) and then "attach" them to the Email record via the hs_attachment_ids property.
All the best,
Zach
--
Zach Klein HubSpot Integrations & App Developer Meanjin / Brisbane, Australia
I suspect this is due to nested arrays set for associations.contactIds and associations.dealIds. Given your Contact and Deal ID variables are arrays themselves, try updating your associations object definition to: