-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
I was reading the documentation and it does not work as the code indicate.
it raise and error not finding a file "models/object_type"
However running the CURL command it works perfectly.
https://developers.hubspot.com/docs/api/crm/associations
I've tested with versions 17.1 and 17.2
# this code fails
require 'hubspot-api-client'
api_client = Hubspot::Client.new(access_token: 'YOUR_ACCESS_TOKEN')
api_response = api_client.crm.objects.basic_api.create(object_type: "deals", object_id: "DEAL_ID", to_object_type: "contacts", to_object_id: "CONTACT_ID", association_spec: [{"associationCategory":"USER_DEFINED","associationTypeId":ASSOCIATION_ID}])# This command works
curl --request PUT \
--url https://api.hubapi.com/crm/v4/objects/deals/DEAL_ID/associations/contacts/CONTACT_ID \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--data '[
{
"associationCategory": "USER_DEFINED",
"associationTypeId": ASSOCIATION_ID
}
]'
max-pi
Metadata
Metadata
Assignees
Labels
No labels