I’m new to hubspot, I want to export all the deals using an API, I’m using POST https://api.hubapi.com/crm/v3/exports/export/async to create an export job with request body like this,
{
“exportType”: “VIEW”,
“exportName”: “test_deals”,
“format”: “CSV”,
“objectType”: “deal”,
“language”: “EN”,
“objectProperties”: [
"hs\_object\_id",
"amount",
"closedate",
"createdate",
"dealname",
"dealstage",
"hubspot\_owner\_id"
],
“publicCrmSearchRequest”: {
"sorts": \[
{
"propertyName": "createdate",
"order": "DESC"
}
]
}
}
Here I’m trying to get the ownerId of the deal by specifying hubspot_owner_id property,But In the response csv file I’m only getting the owner name instead of Id.
Hi @JFlores758
Have you tried the Deals API?
When I run the following call I can see the HubSpot Owner ID in the JSON (not CSV).
https://api.hubapi.com/crm/v3/objects/deals?properties=hubspot_owner_id
Result:
{
"results": [
{
"id": "XXXXXXXXX",
"properties": {
"createdate": "2016-05-01T22:01:18.353Z",
"hs_lastmodifieddate": "2021-10-10T09:37:14.760Z",
"hs_object_id": "XXXXXXXXX",
"hubspot_owner_id": "XXXXXXXXX"
},
"createdAt": "2016-05-01T22:01:18.353Z",
"updatedAt": "2021-10-10T09:37:14.760Z",
"archived": false
},
...
Does that work for you?
Mike
[AMA] Calling all HubSpot Admins! Join me for an AMA on HubSpot Portal Audits and CRM Health
Hi @Mike_Eastwood Thanks for the answer. This API looks good for a workaround. It would’ve been greate if we can make it work with export APIs using CSV and also I see that the number of results I can fetch in this API is 100. I don’t want to make multiple calls.