HubSpot / hubspot-api-python

HubSpot API Python Client Libraries for V3 version of the API
Apache License 2.0
336 stars 107 forks source link

How to get emails of marketing section #315

Closed nghiahsgs closed 3 months ago

nghiahsgs commented 3 months ago

Hi team

I am try to get emails of marketing section I try this code

try:
    # Access the marketing emails API
    email_campaigns = api_client.marketing.emails.get_page(limit=10)
    for email in email_campaigns.results:
        print(f"Email ID: {email.id}, Subject: {email.subject}, Status: {email.status}")
except ApiException as e:
    print("Exception when calling HubSpot API: %s\n" % e)

but it didn't work

it got error

  Traceback (most recent call last):
  File "/Users/lypk/backoffice-services/hubspot-pylib/test.py", line 33, in <module>
    email_campaigns = api_client.marketing.emails.get_page(limit=10)
AttributeError: 'Discovery' object has no attribute 'emails'
nghiahsgs commented 3 months ago
image
alzheltkovskiy-hubspot commented 3 months ago

Hey @nghiahsgs. The functionality you're interested in is currently in beta, so it hasn't been added to the SDK yet, but we plan to include it in one of the upcoming versions.

nghiahsgs commented 3 months ago

Yes, thank for you information @alzheltkovskiy-hubspot !