Skip to navigation

Accounts

This section shows how to fetch account-level entities like locations and companies.

Fetching Locations

You can retrieve all locations associated with an account or search for a specific location by name.

Fetch all locations:

# Fetch all the locations for the account
locations = client.accounts.get_accounts_id_locations(id=ottimate_account_id)

Search for a location by name:

# Search for location name
locations = client.accounts.get_accounts_id_locations(id=ottimate_account_id, search="Demo")

Fetching Companies

Similarly, you can retrieve all companies for an account or search for a specific one.

Fetch all companies:

# Fetch all the companies for the account
companies = client.accounts.get_accounts_id_companies(id=ottimate_account_id)

Search for a company by name:

# Search for company name
companies = client.accounts.get_accounts_id_companies(id=ottimate_account_id, search="demo")