Skip to main content

Microsoft Advertising destination connector package for RETL State contracts.

Project description

RETL Microsoft Advertising Destination

condor-retl-bing-ads is the first-party Microsoft Advertising destination connector package for RETL State contracts. It exposes retl/bing-ads through the retl.destinations entry point group.

Surface

  • customer_lists accepts targeted State Operations and sends Microsoft Advertising Campaign Management API v13 ApplyCustomerListUserData requests to add or remove Customer Match users from Customer List audiences. It accepts email, phone_e164, and mobile_advertising_id Identifiers and requires at least one of those accepted types.

The surface supports managed targets. When a State row emits a logical target that is not mapped or already present in the runtime Target Registry, the connector calls GetAudiencesByIds with Type=CustomerList and empty AudienceIds to inspect account and customer scoped Customer List audiences. For REST JSON the connector sends AudienceIds as null, because the live REST endpoint accepts null or an omitted field but rejects an empty JSON array, then creates a missing target through AddAudiences with Type=CustomerList. Dry runs may perform the read-only lookup, but do not create audiences or write Target Registry rows.

The surface uses custom microsoft_advertising auth with access_token and developer_token credential fields. Request planning remains auth-free and secret-free; runtime submission adds Authorization, DeveloperToken, CustomerAccountId, and CustomerId headers after secret resolution.

Identifier Rendering

email and phone_e164 values are lowercased and SHA-256 hashed unless the input is already a 64-character hexadecimal SHA-256 value, in which case it is trimmed, preserved, and lowercased. mobile_advertising_id is trimmed and sent unhashed. Microsoft accepts one CustomerListItemSubType per request, so RETL partitions batches by target, operation, and identifier subtype.

Binding Config

Required config:

  • customer_account_id: the ad account id used in Microsoft Advertising request headers and as the default parent for account-scoped managed targets.
  • customer_id: the manager customer id used in request headers and as the parent for customer-scoped managed targets.

Optional config:

  • api_version defaults to v13 and is pinned to that value.
  • target_scope defaults to Account and may be set to Customer for managed Customer List creation.
  • membership_duration defaults to -1; Microsoft allows 1 through 390 or -1 for no expiration. Namespace-loaded public config may provide this as -1 or "-1".
  • accept_customer_match_terms defaults to True and is sent as AcceptCustomerMatchTerm on each membership upload. Namespace-loaded public config may provide this as true, false, "true", or "false".
  • transport may be injected for offline tests. When omitted, non-dry-run submissions use the connector's requests transport.

The connector owns the production API origin https://campaign.api.bingads.microsoft.com in package code. Tests use injected transports to capture requests without changing that origin.

The namespace-loadable public config fields are customer_account_id, customer_id, api_version, target_scope, membership_duration, and accept_customer_match_terms.

destination = retl.destinations.load(
    "retl/bing-ads",
    binding_name="bing_ads_primary",
    credential_namespace="destinations.bing_ads",
    config_namespace="destinations.bing_ads",
)

The credential namespace creates retl.secrets["destinations.bing_ads.access_token"] and retl.secrets["destinations.bing_ads.developer_token"] without resolving those secrets during binding construction.

Microsoft API References

Implementation decisions were checked against Microsoft Learn on 2026-05-13:

Proof Level

Default tests provide contract proof for connector metadata, namespace loading, config validation, Customer List request rendering, hashed identifier handling, managed target lookup/create, runtime Target Registry reuse, response classification, selected request-plan submission, and transport failure handling.

Sandbox

Live sandbox tests are opt-in and read credentials from local/env/.env.bing_ads-sandbox when present:

make test-sandbox-bing-ads

The sandbox test creates a disposable managed Customer List audience through AddAudiences, submits one synthetic email add and remove through ApplyCustomerListUserData, and then deletes the disposable list through DeleteAudiences. It does not require a pre-existing Customer List. The test requires:

  • DESTINATIONS__BING_ADS__ACCESS_TOKEN, or both DESTINATIONS__BING_ADS__CLIENT_ID and DESTINATIONS__BING_ADS__REFRESH_TOKEN
  • DESTINATIONS__BING_ADS__DEVELOPER_TOKEN
  • DESTINATIONS__BING_ADS__CUSTOMER_ACCOUNT_ID
  • DESTINATIONS__BING_ADS__CUSTOMER_ID

Optional sandbox config:

  • DESTINATIONS__BING_ADS__API_VERSION
  • DESTINATIONS__BING_ADS__ACCEPT_CUSTOMER_MATCH_TERMS

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

condor_retl_bing_ads-0.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

condor_retl_bing_ads-0.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file condor_retl_bing_ads-0.1.0.tar.gz.

File metadata

  • Download URL: condor_retl_bing_ads-0.1.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for condor_retl_bing_ads-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef0f03aa41c8739ca189e3b41ddfd7d5b2b04f825feadad375ea428a25169133
MD5 a696bcd6674c9c92b9d2536cca0d751a
BLAKE2b-256 dd8136eaba0751ec1ca10fa8719cc7cb6fdcf540fafb10549567c2291575a2e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for condor_retl_bing_ads-0.1.0.tar.gz:

Publisher: publish.yml on condorgraph/condor-retl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file condor_retl_bing_ads-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for condor_retl_bing_ads-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52e905ffbf3960e2fb2d647e60cb103592a57818acc0c95c0225c1e8f2b44f3e
MD5 039eb637c6c3493ebd36f8abb265969b
BLAKE2b-256 c5c224f0c16edcd9e81ae097c1e3070e277308f8a8916b3d1454848018d6e726

See more details on using hashes here.

Provenance

The following attestation bundles were made for condor_retl_bing_ads-0.1.0-py3-none-any.whl:

Publisher: publish.yml on condorgraph/condor-retl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page