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:

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

Search for a location by name:

1# Search for location name
2locations = 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:

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

Search for a company by name:

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