Getting all properties for a specific deal id.

Hi, I have the following code.

I am trying to get return properties for a specific deal id.

endpoint = $“https://api.hubapi.com/crm/v3/objects/deals/” + dId.ToString() + “?properties=all”;
//dId - is the deal Id
HttpResponseMessage response = await client4.GetAsync(endpoint);

if (response.IsSuccessStatusCode)
{
string jsonResponse1 = await response.Content.ReadAsStringAsync();
var dealResponse1 = JObject.Parse(jsonResponse1);
var deal1 = dealResponse1?[“deals”]?.FirstOrDefault();
_propertyValue = deal1?[“properties”]?[“hubspot_owner_id”]?[“value”]?.ToString();

This endpoint only includes some properties, which seem to not relate to the actual properties on the deal (I am looking for standard properties and custom properties)

So the endpoint does not return the required properties - is there another one I can use for a specific deal?

Any help would be appreciated.

Thank you

Hi @CVanWyk,

By default when you make a request to get a deal by ID using GET /crm/v3/objects/deals/it returns a default set of properties - specifically what is shown below:

  • amount, closedate, createdate, dealname, dealstage, hs_lastmodifieddate, hs_object_id, pipeline

If you’d like to control what properties are returned you can use the properties query parmeter but there isn’t a shortcut to pull all of the properties. You need to include a comma separated list of values to retrieve the desired properties. i.e something like:

GET https://api.hubapi.com/crm/v3/objects/deals/{dealId}?properties=dealname,amount,customProp1,customProp2,customProp3

Appreciate it’s not ideal but it’s the only way that it can be done with the APIs today until HubSpot potentially make a change that would support returning all properties with a single query parameter in the request.

Hi @CVanWyk

To retrieve all the property we have write them one by one. There is no option like property=all in HubSpot API.

Hope this will helps you out. Please mark it as Solution Accepted & Upvote to help other Community member.
Thanks!