<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can I pass a method as an argument to a function? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/How-can-I-pass-a-method-as-an-argument-to-a-function/m-p/529840#M48918</link>
    <description>&lt;P&gt;I'm trying to download data from Hubspot with the Python helper library from several tables&lt;/P&gt;&lt;PRE&gt;from hubspot import HubSpot

api_client = HubSpot()
api_client.access_token = 'TOKEN'

contacts = api_client.crm.contacts.get_all()
tickets = api_client.crm.tickets.get_all()
deals = api_client.crm.deals.get_all()
and so on...

&lt;/PRE&gt;&lt;P&gt;Instead of calling every table in a separate way, I was thiniking about looping over a list like this: &lt;A href="https://www.olansiar.com/" target="_blank" rel="noopener"&gt;&lt;FONT color="#FFFFFF"&gt;Website&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;def getting_tables (table, api_client):
    return api_client.crm.table.get_all()

api_client = HubSpot()
api_client.access_token = 'TOKEN'

tables = ['contacts', 'tickets', 'deals', 'owners' ]

for table in tables:
    table = getting_tables(table,api_client)&lt;/PRE&gt;&lt;P&gt;but when I call&amp;nbsp;api_client.crm.table.get_all()&amp;nbsp;it doesnt take "table" as a place holder for what it comes when I call the function. How could I do that? Is that possible?&lt;/P&gt;&lt;P&gt;I know I could just call them all separately, but this is for learning purposes mostly.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 12:26:08 GMT</pubDate>
    <dc:creator>A_mirKhan37</dc:creator>
    <dc:date>2021-11-29T12:26:08Z</dc:date>
  </channel>
</rss>

