⚙ Operations Hub

BRogers1
Participant

Custom Code Not Allowing API Call to Hubspot

Hello,

 

I'm using the custom code option (Python) within a workflow and am trying to call the Hubspot API. I am able to successfully use the Hubspot python library, but I need to call the users endpoints, which are not contained in v4.0.4 of the Hubspot python client used in the workflow client.

 

When I try to use requests to call the /users endpoint, it seems like the workflow client automatically redacts my Hubspot token in the request and I get an auth error. Below is my error followed by the URL used in the GET request, hapikey was redacted by my client automatically

{'status': 'error', 'message': 'Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview', 'correlationId': '2f17cd2d-2fa1-4404-8f9d-85cbb96bd06f', 'category': 'INVALID_AUTHENTICATION'}
https://api.hubapi.com/settings/v3/users/43977603?hapikey=<REDACTED>

My end goal here is to get the email address associated with a particular user that was just assigned a deal to pass along to an outside report. I don't see a standard way of getting that in the properties, but if I missed something please let me know.

4 Replies 4
KPadhiyar
Participant

Custom Code Not Allowing API Call to Hubspot

@BRogers1 Can you please share your custom code. How do you pass access_token in Custom code.
Thanks...

0 Upvotes
MiaSrebrnjak
Community Manager
Community Manager

Custom Code Not Allowing API Call to Hubspot

Hi @BRogers1,

 

thank you for reaching out to the Community!

 

I want to tag in a couple of HubSpot experts & bring this to their attention: 

hi @taran42@Bryantworks@louischausse, do you have any advice or ideas how to solve this? Thank you, you're all rockstars! 

 

Mia, Community team 




Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst


Did you know that the Community is available in other languages?
Join regional conversations by
changing your language settings


ARai9
Participant

Custom Code Not Allowing API Call to Hubspot

@MiaSrebrnjak  @BRogers1 has there been any progress on this. I am facing similar issues when trying to create custom crm object using python sdk for a private app. Please reply ASAP

0 Upvotes
BRogers1
Participant

Custom Code Not Allowing API Call to Hubspot

I basically found a workaroud where I'm just making an API call using requests and a private app key vs. URL token and that is working for me. Would be nice if the python library was more up to date, but requests lets us use any public API and the private app key seems to work without issues in the custom code.

0 Upvotes