APIs & Integrations

miketech
Member

No data on call to get in python

Im attempting to make a call to the get all deals method. I wrote a small python script to return the deals in a python dictionary. For some reason when i print the dict the fields are there, but there is no populated data. Any idea what the problem could be? Thanks!

0 Upvotes
3 Replies 3
miketech
Member

No data on call to get in python

import urllib2, json
APIKEY_VALUE = '325921d8-c8d5-4b99-a59d-0a9a940745ff’
APIKEY = ‘?hapikey=’ + APIKEY_VALUE
HS_API_URL = ‘https://api.hubapi.com/deals/v1/deal/recent/modified

def getDeals():

url = HS_API_URL + APIKEY 

response = urllib2.urlopen(url).read()

statistics = json.loads(response)

return statistics

its returning the dictionaries,but theyre empty…

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

No data on call to get in python

@miketech that API key was for your Developer portal, so normally it won’t have any actual data in it. You’d need to create a test portal, which you can find in the navigation menu when logged into your Developer portal. After creating a test portal, you can get the API key for the test portal:

How do I get my HubSpot API key?

Marketing Basic, Professional, and Enterprise customers and portals with a CRM can access the HubSpot API. Learn how to access your HubSpot API key here.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

No data on call to get in python

@miketech do you have an example of the data you are seeing? or the request that you’re making?

0 Upvotes