APIs & Integrations

FBorrego
Member

HubSpot API Properties

SOLVE

 

Solved: HubSpot Community - An API that extracts all properties information by each company in deals...

 

I was reading this post, it was really helpful, but still, I'm not able to pull all the properties from the deals module. It's just pulling the basic ones and not the custom ones. 

Is there a way to do that ?

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Guide

HubSpot API Properties

SOLVE

Hi @FBorrego 👋

 

You'll need to specify all the properties you'd like returned by the given API endpoint. To get a list of all the properties that are available to specify, you could use the List Properties endpoint first:

 

GET https://api.hubapi.com/crm/v3/properties/DEAL

 

// example response body
{
    "results": [
        {
            "updatedAt": "2024-09-05T17:14:04.747Z",
            "createdAt": "2020-06-30T15:57:38.293Z",
            "name": "amount",
            "label": "Amount",
            "type": "number",
            "fieldType": "number",
            "description": "The total amount of the deal",
            "groupName": "deal_revenue",
            "options": [],
            "displayOrder": 2,
            "calculated": false,
            "externalOptions": false,
            "hasUniqueValue": false,
            "hidden": false,
            "hubspotDefined": true,
            "showCurrencySymbol": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": false
            },
            "formField": false,
            "dataSensitivity": "non_sensitive"
        },
        {
            "updatedAt": "2024-09-05T17:14:04.747Z",
            "createdAt": "2023-11-20T20:31:00.445Z",
            "name": "amount_in_home_currency",
            "label": "Amount in company currency",
            "type": "number",
            "fieldType": "calculation_equation",
            "description": "The amount of the deal, using the exchange rate, in your company's currency",
            "groupName": "deal_revenue",
            "options": [],
            "displayOrder": -1,
            "calculated": true,
            "externalOptions": false,
            "hasUniqueValue": false,
            "hidden": false,
            "hubspotDefined": true,
            "showCurrencySymbol": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": true
            },
            "formField": false,
            "calculationFormula": "if is_present(hs_exchange_rate) then (amount * hs_exchange_rate) else amount",
            "dataSensitivity": "non_sensitive"
        },

        ...

        {
            "updatedAt": "2023-08-11T16:42:34.454Z",
            "createdAt": "2019-08-06T02:41:53.315Z",
            "name": "hs_campaign",
            "label": "HubSpot Campaign",
            "type": "string",
            "fieldType": "text",
            "description": "The marketing campaign the deal is associated with",
            "groupName": "dealinformation",
            "options": [],
            "displayOrder": -1,
            "calculated": false,
            "externalOptions": true,
            "hasUniqueValue": false,
            "hidden": true,
            "hubspotDefined": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": false
            },
            "formField": false,
            "dataSensitivity": "non_sensitive"
        },
        {
            "name": "hs_object_id",
            "label": "Record ID",
            "type": "number",
            "fieldType": "number",
            "description": "The unique ID for this record. This value is set automatically by HubSpot.",
            "groupName": "dealinformation",
            "options": [],
            "displayOrder": -1,
            "calculated": false,
            "externalOptions": false,
            "hasUniqueValue": false,
            "hidden": false,
            "hubspotDefined": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": true
            },
            "formField": false,
            "dataSensitivity": "non_sensitive"
        }
    ]
}

 

You might like to consider using a tool like JSONata to inspect just the property names (JSONata query 'results.name'). Once you know which Deal properties you'd like returned when getting a Deal record (or records), you'll need to specify them via the 'properties' query string parameter. For example:

 
GET https://api.hubapi.com/crm/v3/objects/DEAL/:DEAL_ID?properties=amount,amount_in_home_currency,hs_campaign
 

I hope this proves helpful. Please let me know if you have any follow-up questions

 

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

1 Reply 1
zach_threadint
Solution
Guide

HubSpot API Properties

SOLVE

Hi @FBorrego 👋

 

You'll need to specify all the properties you'd like returned by the given API endpoint. To get a list of all the properties that are available to specify, you could use the List Properties endpoint first:

 

GET https://api.hubapi.com/crm/v3/properties/DEAL

 

// example response body
{
    "results": [
        {
            "updatedAt": "2024-09-05T17:14:04.747Z",
            "createdAt": "2020-06-30T15:57:38.293Z",
            "name": "amount",
            "label": "Amount",
            "type": "number",
            "fieldType": "number",
            "description": "The total amount of the deal",
            "groupName": "deal_revenue",
            "options": [],
            "displayOrder": 2,
            "calculated": false,
            "externalOptions": false,
            "hasUniqueValue": false,
            "hidden": false,
            "hubspotDefined": true,
            "showCurrencySymbol": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": false
            },
            "formField": false,
            "dataSensitivity": "non_sensitive"
        },
        {
            "updatedAt": "2024-09-05T17:14:04.747Z",
            "createdAt": "2023-11-20T20:31:00.445Z",
            "name": "amount_in_home_currency",
            "label": "Amount in company currency",
            "type": "number",
            "fieldType": "calculation_equation",
            "description": "The amount of the deal, using the exchange rate, in your company's currency",
            "groupName": "deal_revenue",
            "options": [],
            "displayOrder": -1,
            "calculated": true,
            "externalOptions": false,
            "hasUniqueValue": false,
            "hidden": false,
            "hubspotDefined": true,
            "showCurrencySymbol": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": true
            },
            "formField": false,
            "calculationFormula": "if is_present(hs_exchange_rate) then (amount * hs_exchange_rate) else amount",
            "dataSensitivity": "non_sensitive"
        },

        ...

        {
            "updatedAt": "2023-08-11T16:42:34.454Z",
            "createdAt": "2019-08-06T02:41:53.315Z",
            "name": "hs_campaign",
            "label": "HubSpot Campaign",
            "type": "string",
            "fieldType": "text",
            "description": "The marketing campaign the deal is associated with",
            "groupName": "dealinformation",
            "options": [],
            "displayOrder": -1,
            "calculated": false,
            "externalOptions": true,
            "hasUniqueValue": false,
            "hidden": true,
            "hubspotDefined": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": false
            },
            "formField": false,
            "dataSensitivity": "non_sensitive"
        },
        {
            "name": "hs_object_id",
            "label": "Record ID",
            "type": "number",
            "fieldType": "number",
            "description": "The unique ID for this record. This value is set automatically by HubSpot.",
            "groupName": "dealinformation",
            "options": [],
            "displayOrder": -1,
            "calculated": false,
            "externalOptions": false,
            "hasUniqueValue": false,
            "hidden": false,
            "hubspotDefined": true,
            "modificationMetadata": {
                "archivable": true,
                "readOnlyDefinition": true,
                "readOnlyValue": true
            },
            "formField": false,
            "dataSensitivity": "non_sensitive"
        }
    ]
}

 

You might like to consider using a tool like JSONata to inspect just the property names (JSONata query 'results.name'). Once you know which Deal properties you'd like returned when getting a Deal record (or records), you'll need to specify them via the 'properties' query string parameter. For example:

 
GET https://api.hubapi.com/crm/v3/objects/DEAL/:DEAL_ID?properties=amount,amount_in_home_currency,hs_campaign
 

I hope this proves helpful. Please let me know if you have any follow-up questions

 

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.