Retrieve the properties of a specific custom object, you can use the "Get all properties for a specific object" endpoint of the HubSpot API. Here's an example of how you can achieve this
import requests
# Set up your authentication headers
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
# Replace 'objectType' with the name of your custom object type
object_type = 'property'
# Send a GET request to retrieve the properties
url = f'https://api.hubapi.com/crm/v3/properties/{object_type}'
response = requests.get(url, headers=headers)
if response.status_code == 200:
properties = response.json().get('results', [])
for property in properties:
property_name = property.get('name')
property_value = property.get('value')
print(f"Property Name: {property_name}, Property Value: {property_value}")
else:
print(f"Error: {response.status_code} - {response.text}")
replace 'YOUR_API_KEY' with your actual HubSpot API key. Also, update the 'objectType' variable with the name of your custom object type, which in your case is 'property'.