Combining data of related entities which happen to separate endpoints

Usually /GET API endpoints allow you to obtain the necessary data pertaining to an entity(Deal/Lead/Contact/Person/etc). Sometimes, there might be a need to combine data from different endpoints (and thereby different entities). In such situations, the following can be done:

  1. Check if the API endpoint response has related_objects property or support for associations
  2. Leverage the search_for_related_items via the item search endpoint
  3. Combining the data in runtime or via a custom API
  4. API management tools
  5. An external tool that does it offline (PowerBI, KNIME, Tableau)

1. Check for related_objects property & associations

For instance, the Activities, Deals, Organizations, Persons & Products contain a related_objects property that lets you get additional information associated with the respective entity.

In addition to that, you can find associated entities via dedicated endpoints too. They usually follow a pattern of

List X associated with Y
List X of Y

Before considering custom approaches, it is recommended to check for such endpoints that can already solve the challenge.

2. Leveraging the search_for_related_items via item search endpoint

You would also notice that the item search endpoint has a flag dedicated to that
search_for_related_items in ItemSearch. When this property is set to true, you can obtain further information associated with the respective entities. However, kindly note that there is a limit on the number of associated entities that you can request.

3. Combining the data in runtime

If the above approaches don’t work, you can always programmatically combine data in a runtime of your choice. However, please be aware of the pagination limits and make sure it is handled as part of the runtime logic. This data can either be used directly or exposed as a custom endpoint of your choice. If you choose to do the latter, make sure it has authentication enabled to avoid unauthorized access.

4. API management tools, gateways

Depending on how you want to combine the data, you can also explore API management tools to solve this challenge. For instance, APIGEE, Mulesoft, and similar tools let you model the transformations and joins that can be performed on disparate resources. The results can be accessed via a single API accordingly.

You can also leverage API gateways in popular cloud environments to model your own data fetch API.

5. Via External Tools

PowerBI, KNIME & Tableau offer a way to fetch data from APIs and perform analysis/visualizations on top of them. It can be considered if the need is ultimately data visualization/analytics.