APIs & Integrations

Augustus
トップ投稿者

Contact associations on custom object not saving

解決

I'm executing a script that takes a list of custom object-to-contact id pairs where each pair of ids needs to be associated to each other.

 

For each id pair, I'm using the association end point on the object to create the association.

 

Ex. https://api.hubapi.com/crm/v3/objects/{custom_obj_type}/{custom_obj_id}/associations/contacts/{contact_id}/custom_object_to_contact

 

For each pair, I receive back a 200 response indicating that the association has been made successfully, however, in cases where a contact id appears more than once in the list, it is only actually saving one occurrence of the contact id to its respective custom object - all other occurrences of this contact id associating to other custom objects will not save - THIS IS DESPITE RECEIVING BACK A 200 ON THESE OTHER OCCURRENCES.

 

Does this have something to do with API calls being made too frequently on a single contact ID?  I have a 1 second delay between each API call - should this be extended?

0 いいね!
1件の承認済みベストアンサー
Augustus
解決策
トップ投稿者

Contact associations on custom object not saving

解決

I recreated the assoction with ONE_TO_MANY as cardinality and inverseCardinality and that corrected the issue.  

元の投稿で解決策を見る

4件の返信
sharonlicari
コミュニティーマネージャー
コミュニティーマネージャー

Contact associations on custom object not saving

解決

thank you for sharing! 🙂


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 いいね!
Augustus
トップ投稿者

Contact associations on custom object not saving

解決

The 200 success responses on the updates is what threw me off because it appeared that all of the associations were saving correctly but it wasn't clear that on each 200 success being returned, the back-end was implicitly removing the association for that contact from the other object it was already associated with.  It would be a nice feature if the response could provide some indication that an association was removed while making the new association due to the cardinality restriction.

0 いいね!
Augustus
トップ投稿者

Contact associations on custom object not saving

解決

I have identified the issue that the association cardinality/inverseCardinality between these two objects is ONE_TO_MANY/ONE_TO_ONE and in fact needs to be ONE_TO_MANY in both directions.


Since I already have this association in place with objects associated, is there a way to update the association cardinality types directly?

 

Ideally, there is a method to update without needing to remove the objects already associated, re-create the association, and then re-associate all of the objects.

0 いいね!
Augustus
解決策
トップ投稿者

Contact associations on custom object not saving

解決

I recreated the assoction with ONE_TO_MANY as cardinality and inverseCardinality and that corrected the issue.