Objects
Objects (also called Entry Types) are the core data structures in DealCloud - Companies, Contacts, Deals, etc. Schema calls use intapp-rest-client under the hood.
get_objects()
Returns all objects configured in your DealCloud site:
from dealcloud_sdk import DealCloud, DealCloudConfig
config = DealCloudConfig(
siteUrl="yoursite.dealcloud.com",
clientId=12345,
clientSecret="your-secret",
)
dc = DealCloud.from_config_object(config)
objects = dc.get_objects()
for obj in objects:
print(f"{obj.id}: {obj.apiName} ({obj.pluralName})")Object Properties
| Property | Type | Description |
|---|---|---|
id | int | Unique object ID |
name | str | Internal name |
apiName | str | API name (used in code) |
singularName | str | Display name (singular) |
pluralName | str | Display name (plural) |
entryListType | int | Object type category |
entryListSubType | int | Object subtype |
Example Output
objects = dc.get_objects()
for obj in objects[:5]:
print(f"ID: {obj.id}")
print(f" API Name: {obj.apiName}")
print(f" Singular: {obj.singularName}")
print(f" Plural: {obj.pluralName}")
print()ID: 2011
API Name: Company
Singular: Company
Plural: Companies
ID: 2012
API Name: Contact
Singular: Contact
Plural: Contacts
...get_entry_type()
Get properties for a single entry type by its ID or API name:
# By API name
company = dc.get_entry_type("Company")
print(f"{company.apiName}: {company.singularName} / {company.pluralName}")
# By numeric ID
company = dc.get_entry_type(2011)
print(f"{company.apiName}: ID {company.id}")Use get_entry_type() when you need a single object's properties without fetching the entire list. This is more efficient than calling get_objects() and filtering.
Finding Objects
By API Name
objects = dc.get_objects()
# Find by API name
company = next((o for o in objects if o.apiName == "Company"), None)
if company:
print(f"Company ID: {company.id}")By Display Name
# Find by display name
company = next((o for o in objects if o.pluralName == "Companies"), None)get_schema()
The get_schema() method returns the complete site schema including all objects and their fields:
schema = dc.get_schema()
# Access objects by API name
company = schema.objects["Company"]
print(f"Company object ID: {company.object.id}")
print(f"Number of fields: {len(company.fields)}")
# List all objects
for api_name, obj_data in schema.objects.items():
print(f"{api_name}: {len(obj_data.fields)} fields")Schema Structure
schema.objects # Dict[str, ObjectSchema]
# Each ObjectSchema contains:
obj_schema.object # Object metadata
obj_schema.fields # Dict[str, Field] - fields by API nameKey Type Options
Control how the schema is keyed:
# Keyed by API name (default)
schema = dc.get_schema(key_type="api")
company = schema.objects["Company"]
name_field = company.fields["CompanyName"]Field subsets (get_fields)
get_schema() loads every object and field for the site. When you only need fields for one entry type—and optionally filtered by editable or entry form visibility—use get_fields() with keyword arguments editable and entry_form (REST: editable, entryForm). These filters apply only with object_id; see the Fields page for the full signature and caching behavior.
# All fields for Company (cached by the SDK per object)
all_fields = dc.get_fields(object_id="Company")
# Only fields shown on the entry form (not cached; hits API each time)
form_fields = dc.get_fields(object_id="Company", entry_form=True)
# Editable fields on the form
editable_form_fields = dc.get_fields(
object_id="Company",
editable=True,
entry_form=True,
)Common Patterns
Object Lookup Helper
def get_object_by_name(dc, name: str):
"""Find object by API name or display name."""
objects = dc.get_objects()
# Try API name first
obj = next((o for o in objects if o.apiName.lower() == name.lower()), None)
if obj:
return obj
# Try display names
obj = next((o for o in objects
if o.singularName.lower() == name.lower()
or o.pluralName.lower() == name.lower()), None)
return obj
company = get_object_by_name(dc, "Company")
# or
company = get_object_by_name(dc, "Companies")Object Field Summary
def summarize_object(dc, object_id):
"""Print summary of an object's fields."""
schema = dc.get_schema()
if object_id not in schema.objects:
print(f"Object '{object_id}' not found")
return
obj = schema.objects[object_id]
print(f"\n{obj.object.pluralName} ({obj.object.apiName})")
print("-" * 40)
# Group by field type
by_type = {}
for field in obj.fields.values():
type_name = str(field.fieldType)
by_type.setdefault(type_name, []).append(field.apiName)
for type_name, fields in by_type.items():
print(f" Type {type_name}: {len(fields)} fields")
summarize_object(dc, "Company")Export Objects List
import pandas as pd
objects = dc.get_objects()
df = pd.DataFrame([
{
"ID": obj.id,
"API Name": obj.apiName,
"Singular": obj.singularName,
"Plural": obj.pluralName,
"Type": obj.entryListType
}
for obj in objects
])
df.to_excel("dealcloud_objects.xlsx", index=False)Caching Schema
For performance, cache the schema locally:
# Fetch once
schema = dc.get_schema()
# Reuse for multiple operations
def get_field_type(object_id: str, field_name: str) -> int:
obj = schema.objects.get(object_id)
if obj:
field = obj.fields.get(field_name)
if field:
return field.fieldType
return None
# All lookups use cached schema
company_name_type = get_field_type("Company", "CompanyName")
contact_email_type = get_field_type("Contact", "Email")Related
- Fields - Field details and metadata
- Schema Export - Export to Excel
- Data API - Reading object data