Oct 17, 202211:34 AM - edited Oct 18, 20221:19 PM
Contributor
CRM API v4 Line Item Association Not Working (Python)
I am using the Python request shown in the Hubspot v4 CRM API docs to associate a line item to a deal, but I am getting an error saying the attribute the docs provide doesn't exist:
api_response = client.crm.line_items.associations_api.items_line_item_id_associations_to_object_type_to_object_id_association_type(line_item_id=lineitem_id, to_object_type="deal", to_object_id=hs_deal_id, association_type="line_item_to_deal")
AttributeError: 'AssociationsApi' object has no attribute 'items_line_item_id_associations_to_object_type_to_object_id_association_type'
Here is my request:
try:
api_response = client.crm.line_items.associations_api.items_line_item_id_associations_to_object_type_to_object_id_association_type(line_item_id=lineitem_id, to_object_type="deal", to_object_id=hs_deal_id, association_type="line_item_to_deal")
pprint(api_response)
pprint("Line Item associated to Deal ID " + hs_deal_id)
except ApiException as e:
print("Exception when calling associations_api->items_line_item_id_associations_to_object_type_to_object_id_association_type: %s\n" % e)
Why do you use/why are you recommending I use that request instead of the one from the line item documentation page pictured below? I use this one for all my other associations, but there seems to be an issue on Hubspot's end that I am trying to point out/resolve.
V4 is having some issues as V4 versions of the APIs are still in development phase, they will work properly after 30th November as HubSpot is sunsetting many API endpoints and versions and updating some changes to the existing ones,