Overview
This source syncs performance reports from the Microsoft Advertising API (Bing Ads API v13) using the officialbingads Python SDK.
Reports are requested asynchronously: the connector submits a report request, polls until the result is ready, downloads the data, and emits one record per row. All three streams use daily aggregation by default and sync incrementally on TimePeriod per ad account, so only new or updated days are fetched on subsequent runs.
Authentication uses OAuth 2.0 with a refresh_token (no service accounts). You provide an Azure AD application’s client_id (and optionally client_secret) alongside a developer_token that identifies your API application.
Configuration
| Key | Required | Default | Description |
|---|---|---|---|
developer_token | ✅ | — | Microsoft Advertising developer token. Identifies your application to the API. Obtained from Microsoft Advertising API Center. |
client_id | ✅ | — | Azure AD Application (client) ID for your registered app. |
client_secret | — | Azure AD client secret. Required for confidential/web app OAuth flows. Leave empty for public/desktop app flows. | |
refresh_token | ✅ | — | OAuth refresh token scoped to https://ads.microsoft.com/msads.manage. See Authentication with OAuth. |
oauth_redirection_uri | https://login.microsoftonline.com/common/oauth2/nativeclient | Redirect URI registered in Azure AD. Must match the URI used when obtaining the refresh token. Required when client_secret is set. | |
customer_id | ✅ | — | Microsoft Advertising manager account (customer) ID the user operates under. |
account_ids | ✅ | — | Comma-separated advertiser account IDs to sync. Find these in the Microsoft Advertising UI under account settings. |
start_date | ✅ | — | Reporting lower bound. Format: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ). |
end_date | today (UTC) | Optional reporting upper bound. | |
environment | production | API environment: production or sandbox. | |
aggregation | Daily | Report aggregation period. Common values: Daily, Weekly, Monthly. | |
report_time_zone | — | ReportTimeZone value. Leave empty to use the account’s default time zone. | |
poll_interval_ms | 5000 | Milliseconds between status polls while the async report is generating. | |
report_timeout_ms | 3600000 | Maximum milliseconds to wait for report download before failing (default 1 hour). |
Legacy key:accountsis accepted as an alias foraccount_idsfor backwards compatibility.
Sample configs
Minimal — production environment, daily reports:Streams
| Stream | Report type | Description |
|---|---|---|
campaign_performance_report | CampaignPerformanceReportRequest | Daily campaign-level impressions, clicks, spend, and conversions. |
ad_group_performance_report | AdGroupPerformanceReportRequest | Daily ad group-level performance metrics. |
ad_performance_report | AdPerformanceReportRequest | Daily ad-level performance metrics. |
TimePeriod (one bookmark per ad account). On the first run the full history from start_date is fetched; subsequent runs fetch only new or updated days.
How to get credentials
1. Developer token
- Sign in to Microsoft Advertising as the account owner or a user with API access.
- Go to Tools → API Center (or visit the Microsoft Advertising API Center directly).
- Request and copy your developer token.
2. Azure AD app (client_id / client_secret)
- Open Azure Portal → App registrations and click New registration.
- Choose Public client / native for desktop flows (no
client_secretrequired) or Web for server flows. - Add
https://login.microsoftonline.com/common/oauth2/nativeclientas a redirect URI (or your own URI for web flows). - Copy the Application (client) ID →
client_id. - For web flows: go to Certificates & secrets and create a client secret →
client_secret.
3. Refresh token
Use the Microsoft Advertising OAuth guide to complete the authorization code flow with the scopehttps://ads.microsoft.com/msads.manage offline_access. Copy the resulting refresh_token into your config.
4. customer_id and account_ids
Find these in the Microsoft Advertising UI:
- Customer ID — shown in the top-right account selector next to your account name.
- Account IDs — visible in Accounts Summary or each account’s settings page.
Related links
- Microsoft Advertising API — Get Started
- Authentication with OAuth
- Reporting Service overview
- ReportTimeZone values