Skip to content

import_data does not work with Service Accounts due to missing project_id #110

@beheh

Description

@beheh

While testing out service accounts, I kept getting Unauthorized, invalid project secret. See docs for more information: https://developer.mixpanel.com/reference/authentication#project-secret raised from the SDK

I ended up tracing this to the SDK never sending the project_id GET paramter to the import. This paramter is marked as required in the documentation.

Trying the following curl command:

curl --request POST \
  --url 'https://api.mixpanel.com/import?strict=1' \
  --header 'Accept: application/json' \
  --header 'Authorization: Basic <omitted>' \
  --header 'Content-Type: application/json' \
  --data '[{"event":"test"}]'

vs.

curl --request POST \
  --url 'https://api.mixpanel.com/import?strict=1&project_id=<omitted>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Basic <omitted>' \
  --header 'Content-Type: application/json' \
  --data '[{"event":"test"}]'

...with credentials and with/without a project_id confirms the problem.

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