APIs & Integrations

Augustus
Colaborador líder

Contact associations on custom object not saving

resolver

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 Me gusta
1 Soluciones aceptada
Augustus
Solución
Colaborador líder

Contact associations on custom object not saving

resolver

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

Ver la solución en mensaje original publicado

4 Respuestas 4
sharonlicari
Administrador de la comunidad
Administrador de la comunidad

Contact associations on custom object not saving

resolver

thank you for sharing! 🙂


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




0 Me gusta
Augustus
Colaborador líder

Contact associations on custom object not saving

resolver

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 Me gusta
Augustus
Colaborador líder

Contact associations on custom object not saving

resolver

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 Me gusta
Augustus
Solución
Colaborador líder

Contact associations on custom object not saving

resolver

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