PostHog / PostHog/posthog

AppsFlyer source rejects valid credentials due to invalid dailyreport endpoint

Open Beginner friendly
#64,004 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Bug Description

The AppsFlyer data warehouse source rejects valid AppsFlyer credentials with:

Invalid AppsFlyer API token or app id

The credentials are valid. The backend validation appears to call an invalid AppsFlyer aggregate report endpoint.

PostHog appears to call:

/api/agg-data/export/app/{app_id}/dailyreport/v5

AppsFlyer returns:

400 Invalid query: Unknown report type: dailyreport

The valid endpoint is:

/api/agg-data/export/app/{app_id}/daily_report/v5

With the same app ID and token, these AppsFlyer endpoints return HTTP 200 directly:

  • daily_report/v5
  • geo_by_date_report/v5
  • partners_by_date_report/v5

This blocks creating the AppsFlyer data warehouse source in PostHog Cloud.

How to reproduce

  1. Go to Data warehouse > New source > AppsFlyer.
  2. Enter a valid AppsFlyer API token V2 and a valid iOS app ID, e.g. id....
  3. Click Next.

Expected: PostHog validates the credentials and proceeds to table selection.

Actual: PostHog returns Invalid AppsFlyer API token or app id.

Additional context

Relevant code in the current PostHog repo:

posthog/temporal/data_imports/sources/appsflyer/appsflyer.py

f"{APPSFLYER_BASE_URL}/api/agg-data/export/app/{quote(app)}/dailyreport/v5"

This should likely be:

f"{APPSFLYER_BASE_URL}/api/agg-data/export/app/{quote(app)}/daily_report/v5"

Also in:

posthog/temporal/data_imports/sources/appsflyer/settings.py

"daily_report": AppsFlyerEndpointConfig(
    name="daily_report",
    report="dailyreport",
),

This should likely use:

report="daily_report"
Debug info
- [x] PostHog Cloud, Debug information: [redacted]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with posthog/temporal/data_imports/sources/appsflyer/appsflyer.py and settings.py, focusing on the daily report endpoint and its AppsFlyerEndpointConfig. Verify the endpoint and report name against the valid AppsFlyer paths described in the issue. Done means valid credentials pass backend validation and the AppsFlyer source proceeds to table selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.