microsoft/bingads
The official Bing Ads PHP SDK provides proxy classes for all Bing Ads API web services, handling OAuth authentication and low-level SOAP details so you can build Bing Ads applications in PHP. Install via Composer as microsoft/bingads, autoload with PSR-4, and manage campaigns, ads, and reports progr...
ext-soap. This reduces boilerplate for OAuth, authentication, and request/response handling. The 13.0.30.1 release does not change the transport model, so the existing wrapper strategy remains valid.CampaignManagementService, ReportingService, BulkService), mirroring Laravel’s modular service layer pattern. The new release materially expands two of these surfaces:
UpdateMedia, campaign term exclusions, and AI prompt audiences all land here, increasing the surface area of the service our domain wrappers must cover.2026-10-12 should be validated against the msads.manage scope and any tenant-consent requirements; re-test token issuance and refresh in both sandbox and production before rollout.UpdateMedia: Enables in-place mutation of media assets, which changes our media lifecycle from append-only to mutable. This has direct implications for caches and local mirrors of creative assets.Auth facade or custom guards for user-specific Bing Ads access (e.g., agency clients).ShouldQueue). The new bulk account mappings and UpdateMedia are strong queue candidates.bingads.campaign.created, bingads.media.updated, bingads.ai_content.labeled) for downstream processing (analytics, notifications, compliance audit trail).UpdateMedia and bulk file operations map naturally to Laravel’s Storage facade and filesystem disks, which is a cleaner fit than the previous version, where media handling had to be hand-rolled.MaxCpc limits) can map to Laravel’s FormRequest validation. New AI disclosure fields and prompt-audience payloads need their own validation rules and length/format constraints — derive these from the docs rather than guessing.GetCampaignsByIds) may require chunking for large datasets. Bulk operations with account mappings will be larger payloads than before — plan chunk sizes and memory ceilings for bulk jobs specifically.BingAdsException) should translate SOAP errors to Laravel’s Problem or HttpException classes. Add distinct handling for media-update partial failures, which are likely to be per-asset rather than per-request.2026-10-12. The prior assessment assumed API v13 alignment. Any local integration built against the older revision should be re-verified field-by-field before upgrading. Treat this as a versioned migration, not a patch bump.UpdateMedia Mutability Risk: Moving from immutable media references to mutable assets risks stale caches, stale CDN URLs, and divergent local mirrors. Any existing cache of creative assets must have an invalidation path.msads.manage scope remains default; legacy scopes (e.g., msads.read) may fail. Re-test post-upgrade, especially for multi-tenant agency flows.ext-soap Requirement: Must be enabled in php.ini. Use Laravel’s php artisan package:discover or a custom check in bootstrap/app.php to fail fast if missing..env for environment-specific configs (e.g., BINGADS_SANDBOX=true). Not all new AI/bulk features are reliably available in sandbox — confirm coverage early.php-soap-mock or custom MockHandler classes can help. Add fixtures for AI label payloads, UpdateMedia responses, and bulk account-mapping files.2026-10-12 revision change any field names, required fields, or enum values we depend on?UpdateMedia is in use?HasApiTokens)?BingAdsService) with environment-specific configs (sandbox/production).config/bingads.php:
'api_revision' => env('BINGADS_API_REVISION', '2026-10-12'),
'scopes' => [
'production' => ['msads.manage'],
'sandbox' => ['msads.manage'],
],
'features' => [
'ai_content_labels' => false, // gated pending compliance sign-off
'ai_prompt_audiences' => false, // gated pending data model decision
'update_media' => false, // gated pending cache invalidation design
'bulk_account_mappings' => false,
],
BingAds facade for concise syntax (e.g., BingAds::campaign()->getByIds([123])).Storage facade for UpdateMedia payloads and bulk upload/download files. Keep media assets on a versioned disk path to make rollback possible.Cache::remember(), with explicit tags/keys so UpdateMedia can invalidate them.bingads_campaigns table. Add:
account_hierarchy table for parent customer number and related account mappings (validated before bulk submit);ai_content_label, ai_detection_metadata, ai_label_source) on creative entities;bingads_media table with version/revision columns.BingAdsAuthMiddleware) for protected routes; route model binding for resources.2026-10-12.ext-soap and verify with php -m | grep soap.encrypter; build a BingAdsAuth service for refresh and scope validation.CampaignService, ReportingService, MediaService, BulkService).
class CampaignService {
public function __construct(private BingAdsService $bingAds) {}
public function syncCampaigns(array $campaignIds): array {
return $this->bingAds->campaignManagement()
->GetCampaignsByIds(['CampaignIds' => $campaignIds]);
}
}
UpdateMedia: implement behind a flag with cache invalidation and media versioning; queue per-asset updates with partial-failure reporting.BingAdsJob queue workers with retry/backoff.php artisan bingads:refresh-campaigns, bingads:validate-account-mappings) and admin UI surfaces for AI labels and media versions.soap, curl, openssl; recommended redis (token caching), queue, and fileinfo (media handling for UpdateMedia).2026-10-12. Verify account provisioning matches. Prior-revision behavior is not guaranteed to be forward-compatible — treat any silent field behavior change as a break..env credentials; complete the revision impact audit; confirm compliance position on AI disclosure.UpdateMedia with cache invalidation and versioning, queued.2026-10-12 confirms this SDK tracks Microsoft's release train closely. Budget a recurring per-release triage task (audit → contract tests → flag-gated rollout) rather than treating upgrades as ad hoc.UpdateMedia, bulk mappings) must each have an owner and a retirement condition. Ungated flags become invisible technical debt within two quarters.max_execution_time need tuning for bulk workers specifically.UpdateMedia adds a write-heavy, payload-heavy path. Plan worker pools separately from read/report traffic, and watch storage growth and egress.| Failure | Impact | Mitigation |
|---|---|---|
| SDK upgrade changes field behavior under new revision | Silent data loss/incorrect syncs | Contract tests per service; flag-gated rollout; pin previous version for rollback |
ext-soap missing in a deploy target |
Hard failure at boot | Boot-time capability check; fail fast in CI |
UpdateMedia succeeds but caches not invalidated |
Stale creatives served to users | Version-keyed cache; invalidate on write; TTL ceiling |
| Bulk job writes to wrong account via bad mapping | High severity, client-visible | Validate against hierarchy table; dry-run mode; reject unknown parent customer numbers |
| AI content label not propagated | Compliance exposure | Label required-field validation; audit log; block publish when label absent |
| Partial media-update failures | Inconsistent creative set | Per-asset result tracking; retry just the failed assets |
| Prior revision sunset passes unnoticed | Total integration outage | Calendar the deprecation date; subscribe to release notes |
| SOAP timeout during long report generation | Orphaned jobs, duplicate downloads | Idempotent job keys; queue retries with backoff |
UpdateMedia, AI metadata). Estimate one sprint for upgrade + contract tests, then one to two sprints per higher-risk feature.How can I help you explore Laravel packages today?