CRM Export Request

Hi all,

I’m creating a HubSpot CRM Export API in Alteryx. I’m running into an issue where it can’t find the modules and classes associated with the CRM. When I looked at the hubspot package it installed, there was not an exports subfolder present in the CRM folder.

Below are the two code snippets I’ve tried with the error messages it produced.

from ayx import Package
from ayx import Alteryx

Alteryx.installPackages(package=[‘hubspot’,‘hubspot-api-client’], install_type=“install --user”)

import hubspot
from pprint import pprint
from hubspot.crm import PublicExportRequest, ApiException

ImportError: cannot import name 'PublicExportRequest' from 'hubspot.crm' (C:\Users\user\AppData\Roaming\Python\Python38\site-packages\hubspot\crm\__init__.py)

from ayx import Package
from ayx import Alteryx

Alteryx.installPackages(package=[‘hubspot’,‘hubspot-api-client’], install_type=“install --user”)

import hubspot
from pprint import pprint
from hubspot.crm.exports.export.async import PublicExportRequest, ApiException

File "<ipython-input-1-d51b27589af1>", line 9
 from hubspot.crm.exports.export.async import PublicExportRequest, ApiException
 ^
SyntaxError: invalid syntax   

Look forward to hearing your solutions on this!

Hi @taylorgruendel

The issue you’re experiencing with the Export API in Alteryx is tending due to an incorrect import path for the PublicExportRequest class.

  • The first code snippet’s import statement appears to be correct, but the error message suggests a potential issue with the HubSpot library installation or version incompatibility.
  • The second code snippet’s import statement attempts to access the class through a specific subfolder structure, but contains a syntax error, as indicated by the “invalid syntax” error message.

To resolve the issue, try correcting the import path and ensure the HubSpot library is installed and up-to-date.

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards