Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby example code doesn't work from API Associations Schema Documentation #328

Open
Samsinite opened this issue Aug 15, 2024 · 1 comment

Comments

@Samsinite
Copy link

At https://developers.hubspot.com/beta-docs/reference/api/crm/associations/associations-schema#get-%2Fcrm%2Fv4%2Fassociations%2F%7Bfromobjecttype%7D%2F%7Btoobjecttype%7D%2Flabels provides the following ruby code:

require 'hubspot-api-client'

api_client = Hubspot::Client.new(access_token: 'YOUR_ACCESS_TOKEN')

api_response = api_client.crm.associations.definitions.configurations.all.definitions_api.get_all(from_object_type: "fromObjectType", to_object_type: "toObjectType")
puts api_response

When trying out calling api_client.crm.associations.definitions.configurations.all.definitions_api.get_all in our app integration code, it ran into the error NoMethodError: undefined method definitions' for #Hubspot::Discovery::Crm::Associations::Client:0x000000013159aa60`. Executing the example code to a "T" also generates the same error:
Screenshot 2024-08-15 at 11 18 44 AM

@Samsinite Samsinite changed the title Ruby example code doesn't work from API Documentation Ruby example code doesn't work from API Associations Schema Documentation Aug 15, 2024
@Samsinite
Copy link
Author

Looks like the correct code should be:

require 'hubspot-api-client'

api_client = Hubspot::Client.new(access_token: 'YOUR_ACCESS_TOKEN')

api_response = api_client.crm.associations.v4.schema.definitions_api.get_all(from_object_type: "fromObjectType", to_object_type: "toObjectType")
puts api_response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant