Hi all;
This is a basic getting started question. And the answer must exist somewhere, but I can’t find it. So apologies asking if it’s answered somewhere.
So using Deals as an example, is there a way to:
- Get all properties, including their type.
- If a property is a foreign key to the primary key in another object (or whatever this is called here), that it identifies itself as a link and to what object?
- Is it possible to do a GET for a collection deals where it gives a filter against any set of properties (like “Contact’s Industry contains “Acme””?
- Is it possible to do a GET with filters where it returns a count of objects that would be returned, but in this case just returns the number?
thanks - dave
Hey @DavidThielen
Let’s walk through these.
First of all, the call is basically the same for any Object. You will just replace the objectType with whatever object you are wanting.
Secondly, I would recommend reading through this to just get a good overview of the crm
https://api.hubapi.com/crm/v3/properties/objectType will list all properties. You can see all of the endpoints here
- I believe you are talking about associations. You can use this endpoint
/crm/v3/objects/deals/{dealId}/associations/{toObjectType}
- You can use the search endpoint here :
/crm/v3/objects/deals/search . Do note that this is a post request as you will be adding your search in a json body which ends up looking like this{ "filterGroups": [ { "filters": [ { "value": "string", "propertyName": "string", "operator": "EQ" } ] } ], "sorts": [ "string" ], "query": "string", "properties": [ "string" ], "limit": 0, "after": 0 }
- The above request will return a total.
Hope this answers some questions!