Olá! Nós temos uma Comunidade em Português!

No data on call to get in python

Neues Mitglied

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!

Responder
0 Avaliação positiva
3 Respostas 3
Community-Manager

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

Responder
0 Avaliação positiva
Highlighted
Neues Mitglied

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…

Responder
0 Avaliação positiva
Community-Manager

@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.

Responder
0 Avaliação positiva