APIs & Integrations

Ronnie1
参加者 | Elite Partner
参加者 | Elite Partner

Get all properties of a Deal object using v3 api.

解決

Hey everyone,

I have a Deal object with a lot of custom properties and property groups.

 

I'm looking for a way to get them all without typing them all out like this:

api_response = client.crm.deals.basic_api.get_by_id(deal_id="dealId", properties=["hubspot_owner_id, dealstage, etc..."], archived=False)

 

I believe there's a way to achieve this in v1 api using: "includeAllProperties = true"

 

so ideal would be something like this:

api_response = client.crm.deals.basic_api.get_by_id(deal_id="dealId", includeAllProperties = true, archived=False)

 

Thanks for the help!

0 いいね!
1件の承認済みベストアンサー
Teun
解決策
名誉エキスパート | Diamond Partner
名誉エキスパート | Diamond Partner

Get all properties of a Deal object using v3 api.

解決

Hi @Ronnie1 ,

 

If you just need a overview of all properties, you could use the Deal properties API to get all properties. Alternative would be to export all properties through the HubSpot UI, which would give you a handy spreadsheet of all properties (Settings > Properties > Export all properties).

The quickest way to fix your issue is probably creating an array once and store that as a variable in your script. It is quite an annoying job, but sadly, a solution as includeAllProperties is not available at this time. You can create the array by using the API mentioned above or export all properties to a CSV or XLSX file.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


元の投稿で解決策を見る

3件の返信
webdew
ガイド役 | Diamond Partner
ガイド役 | Diamond Partner

Get all properties of a Deal object using v3 api.

解決

Hi @Ronnie1 ,
Please use below code for get all deals via API. this code will help's

<?php

$url = 'https://api.hubapi.com/deals/v1/deal/paged?hapikey=demo&includeAssociations=true&limit=2&properties=...';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);

if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);

?>


Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regard.

0 いいね!
Ronnie1
参加者 | Elite Partner
参加者 | Elite Partner

Get all properties of a Deal object using v3 api.

解決

I quess I'll have to make very long array of properties then.

 

Thanks again.

0 いいね!
Teun
解決策
名誉エキスパート | Diamond Partner
名誉エキスパート | Diamond Partner

Get all properties of a Deal object using v3 api.

解決

Hi @Ronnie1 ,

 

If you just need a overview of all properties, you could use the Deal properties API to get all properties. Alternative would be to export all properties through the HubSpot UI, which would give you a handy spreadsheet of all properties (Settings > Properties > Export all properties).

The quickest way to fix your issue is probably creating an array once and store that as a variable in your script. It is quite an annoying job, but sadly, a solution as includeAllProperties is not available at this time. You can create the array by using the API mentioned above or export all properties to a CSV or XLSX file.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.