APIs & Integrations

maelle
Participant

Discrepancy between "Get all deals" docs and reality?

SOLVE

In https://developers.hubspot.com/docs/methods/deals/get-all-deals

 

the example JSON shows associations but if I copy paste the URL in my browser I get no association. Am I missing something? How can I get associations in deals?

 

Docs

 

```

{
  "deals": [
    {
      "portalId": 62515,
      "dealId": 18039629,
      "isDeleted": false,
      "associations": {
        "associatedVids": [
          393873, 734934
        ],
        "associatedCompanyIds": [
          237892
        ],
        "associatedDealIds": [
          
        ]
      },
      "properties": {
        "dealname": {
          "value": "Company",
          "timestamp": 1457040864519,
          "source": "API",
          "sourceId": null,
          "versions": [
            {
              "name": "dealname",
              "value": "Company Name",
              "timestamp": 1457040864519,
              "source": "API",
              "sourceVid": [
                
              ]
            }
          ]
        },
        "num_associated_contacts": {
          "value": "2",
          "timestamp": 0,
          "source": "CALCULATED",
          "sourceId": null,
          "versions": [
            {
              "name": "num_associated_contacts",
              "value": "2",
              "source": "CALCULATED",
              "sourceVid": [
                
              ]
            }
          ]
        }
      },
      "imports": [
        
      ]
    },
    {
      "portalId": 62515,
      "dealId": 18040854,
      "isDeleted": false,
      "associations": {
        "associatedVids": [
          
        ],
        "associatedCompanyIds": [
          
        ],
        "associatedDealIds": [
          
        ]
      },
      "properties": {
        "dealname": {
          "value": "5678",
          "timestamp": 1457042290572,
          "source": "API",
          "sourceId": null,
          "versions": [
            {
              "name": "dealname",
              "value": "5678",
              "timestamp": 1457042290572,
              "source": "API",
              "sourceVid": [
                
              ]
            }
          ]
        },
        "num_associated_contacts": {
          "value": "0",
          "timestamp": 0,
          "source": "CALCULATED",
          "sourceId": null,
          "versions": [
            {
              "name": "num_associated_contacts",
              "value": "0",
              "source": "CALCULATED",
              "sourceVid": [
                
              ]
            }
          ]
        }
      },
      "imports": [
        
      ]
    }
  ],
  "hasMore": true,
  "offset": 18040854
}

 

What I get https://api.hubapi.com/deals/v1/deal/paged?hapikey=demo&includeAssociations=true&limit=2&properties=...

 

 

{
"deals":[
{
"portalId":62515,
"dealId":931633510,
"isDeleted":false,
"associations":{
"associatedVids":[

],
"associatedCompanyIds":[

],
"associatedDealIds":[

],
"associatedTicketIds":[

]
},
"properties":{
"dealname":{
"value":"Example deal",
"timestamp":1565733537449,
"source":"CRM_UI",
"sourceId":"dadams@hubspot.com",
"versions":[
{
"name":"dealname",
"value":"Example deal",
"timestamp":1565733537449,
"sourceId":"dadams@hubspot.com",
"source":"CRM_UI",
"sourceVid":[

]
}
]
}
},
"imports":[

],
"stateChanges":[

]
}
],
"hasMore":false,
"offset":931633511

}

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Discrepancy between "Get all deals" docs and reality?

SOLVE

Hi @maelle,

 

Happy to help clarify the confusion here. The example JSON here is not an indication of the example get url https://api.hubapi.com/deals/v1/deal/paged?hapikey=demo&includeAssociations=true&limit=2&properties=... response result. It is two separate example. 

 

The get url example deal doesn't have any associations which is why you ain't seeing any associated vid for the objects. 

 

That said, if you tried using this endpoint with your own hapikey and include the includeAssociations=true parameter, you will be able to see the associations of the deal (if there's any).

View solution in original post

2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Discrepancy between "Get all deals" docs and reality?

SOLVE

Hi @maelle,

 

Happy to help clarify the confusion here. The example JSON here is not an indication of the example get url https://api.hubapi.com/deals/v1/deal/paged?hapikey=demo&includeAssociations=true&limit=2&properties=... response result. It is two separate example. 

 

The get url example deal doesn't have any associations which is why you ain't seeing any associated vid for the objects. 

 

That said, if you tried using this endpoint with your own hapikey and include the includeAssociations=true parameter, you will be able to see the associations of the deal (if there's any).

maelle
Participant

Discrepancy between "Get all deals" docs and reality?

SOLVE

Thanks! Maybe it could be clarified a bit in the docs i.e. writing there that the example JSON won't be obtained with that URL and the demo key?

0 Upvotes