Function to search for associated objects does not work
Hello guys, how are you? I am carrying out an API integration and associated a company with an event (1 event (which is a customObject) can have several companies) The association worked correctly and I can view it through Hubspot, but I am not able to search for this data in the API, when I click on the list of associations it only returns the ID's of the associated data, I need you to bring me all the company and event data, how do I do it? that?
If I understood correctly, you want to retrieve the event and all of it's associated companies including it's properties.
This isn't possible using the regular API. If you make a GET request to `/crm/v3/objects/<object>/{recordId}?associations=companies` you can retrieve the ID's of the associated companies, when you have those, you can retrieve those companies through a second API call.
If you use GraphQL, you can retrieve all that information in a single API call.
Learn more about HubSpot by following me on LinkedIn or YouTube
✅ Did my answer solve your issue? Help the community by marking it as the solution.
Function to search for associated objects does not work
I'm trying to use GraphQL but I keep getting the following error:
Status code 403 {"status":"error","message":"This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes.","correlationId":"0f925c51-9062-415c-81e3-a39fd21c2044","errors":[{"message":"All of the following scopes are required.","context":{"requiredScopes":["collector.graphql_query.execute"]}}],"links":{"scopes":"https://developers.hubspot.com/scopes"},"category":"MISSING_SCOPES"}
However, I have already added this scope to my key and it continues to display the error.