Workflow: Migrate an API key integration to a private app
lösung
We have to change our custom code in workflows (python) from Key to Token. In my console, the code works fine. Easy to change, but in the workflow I get an Error.
from hubspot import HubSpot
from hubspot.crm.quotes import ApiException
hubspot = HubSpot(access_token=os.getenv("HTOKEN"))
hubspot.crm.quotes.associations_api.get_all(quote_id="56948949", to_object_type="deal", limit=1)
->
[ERROR] ApiException: (401)
Reason: Unauthorized
HTTP response body: {"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":"a166f3d7-1fb9-46f5-a7cf-9fee0787b985","category":"INVALID_AUTHENTICATION"}
I think the issue may be that the custom coded workflow actions use an older version of the HubSpot client v4.0.4. https://github.com/HubSpot/hubspot-api-python/releases. Unfortunately there is no way to upgrade the client within a workflow. The only other thing I can think of is not to use the HubSpot client and instead use the Python requests 2.26.0 library. That works for me using below:
I think the issue may be that the custom coded workflow actions use an older version of the HubSpot client v4.0.4. https://github.com/HubSpot/hubspot-api-python/releases. Unfortunately there is no way to upgrade the client within a workflow. The only other thing I can think of is not to use the HubSpot client and instead use the Python requests 2.26.0 library. That works for me using below: