Skip to content

Error when querying email events with eventType parameter #413

@ghost

Description

Issue Description

When using the HubSpot API client to query email events, I encountered an error with the eventType parameter format. The API rejects the comma-separated list within curly braces:

response = api_client.api_request({
    "method": "GET",
    "path": "/email/public/v1/events",
    "qs": {
        "eventType": "{SENT,DELIVERED}",
    }
})
print(response.content.decode('utf-8'))

This results in the following error:

{"status":"error","message":"Invalid input JSON on line -1, column -1: Cannot deserialize value of type `com.hubspot.email.events.EventType` from String \"{SENT,DELIVERED}\": not one of the values accepted for Enum class: [DROPPED, UNBOUNCE, STATUSCHANGE, DELIVERED, FORWARD, BOUNCE, REPLY, PRINT, PROCESSED, UNSUBSCRIBED, SUPPRESSED, CLICK_ON_IDENTIFIED_LINK, SENT, SELECTED, SPAMREPORT, OPT_IN_CHANGE, DEFERRED, ERROR, OPEN, MTA_DROPPED, CLICK]","correlationId":"3196b1fe-b2fb-4498-b8f5-afa46570a809"}

Additional Information

https://developers.hubspot.com/docs/reference/api/analytics-and-events/email-analytics#get-email-events

I verified that the API endpoint itself works correctly with the following curl command, which successfully returns results:

curl --request GET --url 'https://api.hubapi.com/email/public/v1/events?eventType={SENT,DELIVERED}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions