Skip to content

Add support for strict query parameter on /import and /engage endpoints #145

@benjy44

Description

@benjy44

Description:

The Mixpanel API supports a strict query parameter on /import and /engage endpoints for better validation and error reporting. The SDK currently doesn't support passing query parameters to these endpoints.

Attempted Workaround:

consumer = BufferedConsumer(
    import_url="https://api-eu.mixpanel.com/import?strict=1"
)

Error:

mixpanel.MixpanelException: Mixpanel error: illegal base64 data at input byte 0

This fails because the SDK sends application/x-www-form-urlencoded data, and the strict parameter in the URL causes Mixpanel to misinterpret the request format.

Proposed Solution:

Add a way to pass query parameters to endpoints, such as:

consumer = BufferedConsumer(
    api_host="api-eu.mixpanel.com",
    query_params={'strict': '1'}  # or import_query_params={'strict': '1'}
)

Alternative: Add a specific strict=True/False parameter to the Consumer constructor.

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