Customer + Reporting API
Microsoft Ads
Connect Microsoft Ads, sync account inventory, and make the data available for client PPC audits and reporting.
Missing: none
Client ID + secret
Needed for cron syncs
Ready for client mapping
Missing: customer_id, account_id
What Needs Attention
Work these in order before expecting Microsoft Ads audits or client reports to be complete.
Map Microsoft Ads accounts to clients
MappingAttach synced Microsoft Ads account IDs from each client's workspace so PPC audits and reporting can use the data.
Sync Actions
Run inventory first, then sync recent performance after accounts are available.
Setup Checklist
Complete these steps before mapping Microsoft Ads accounts to clients.
- 1 Set Azure app client ID and client secret
- 2 Add Microsoft Ads developer token
- 3 Run OAuth and save the refresh token
- 4 Sync account inventory
- 5 Map accounts to clients
- 6 Sync recent performance
| Credential | Status | Role |
|---|---|---|
| Client ID | Set | Required |
| Client Secret | Set | Required |
| Developer Token | Set | Required |
| Refresh Token | Set | Required |
| Default Customer ID | Missing | Optional fallback |
| Default Account ID | Missing | Optional fallback |
Microsoft Credential Renewal Reminders
Microsoft Azure credential expires in 721 days on 2028-06-05. Update MICROSOFT_ADS_CLIENT_SECRET_EXPIRES_AT after rotating it.
MICROSOFT_ADS_REFRESH_TOKEN_EXPIRES_AT is not set. Add a YYYY-MM-DD value in Render so the app can warn before this credential needs rotation.
Synced Accounts
Attach these account IDs from each client's setup/platform area using platform microsoft_ads.
| Account | Customer ID | Account ID | Status |
|---|---|---|---|
| Summit Roofing Bing | ms_customer_9001 | ms_demo_2001 | Active |
| Canyon HVAC Search | ms_customer_9004 | ms_demo_2004 | Active |
| Prairie Plumbing Search | ms_customer_9007 | ms_demo_2007 | Active |
| Northstar Outdoor Search | ms_customer_9010 | ms_demo_2010 | Paused |
Advanced / Diagnostics Redirect URI, API endpoints, cron commands, and official docs
Redirect URI: https://command.mdmppc.com/auth/microsoft-ads/callback
Scope: offline_access https://ads.microsoft.com/msads.manage
Customer API: https://clientcenter.api.bingads.microsoft.com
Reporting API: https://reporting.api.bingads.microsoft.com
python scripts/run_daily_microsoft_ads_inventory_sync.pypython scripts/run_daily_microsoft_ads_sync.py
Synced performance rows are stored in microsoft_ads_campaign_daily.
- https://learn.microsoft.com/en-us/advertising/guides/get-started?view=bingads-13
- https://learn.microsoft.com/en-us/advertising/guides/authentication-oauth-get-tokens?view=bingads-13
- https://learn.microsoft.com/en-us/advertising/customer-management-service/getuser?view=bingads-13
- https://learn.microsoft.com/en-us/advertising/reporting-service/submitgeneratereport?view=bingads-13
- https://learn.microsoft.com/en-us/advertising/reporting-service/pollgeneratereport?view=bingads-13