Skip to main content
Mount @bijectionhq/app-microsoft-advertising for microsoft-advertising.performance.report. Use a Microsoft Advertising v13 reporting principal with access to the chosen account. Declare the OAuth access token and the developer token as separate secrets for the reporting receiver.
app.ts
msads.operator is granted from code: ctx.grant(msads.operator, { to, under }) in one of your mutations (Grants). The mount requires a protected data label: under the public label reports.start refuses PublicLabel. Its operator role clears data and is the only role msads.reports.start, msads.reports.status and msads.records.list allow. Review the exact download hostnames your Microsoft Reporting API returns before binding the download receiver. The hostname in this example comes from a recorded report. Microsoft can change its download host. The receiver requires an approved public DNS name on HTTPS port 443, pins the resolved address, and sends the provider’s temporary URL without the reporting credentials. A redirect is not followed. The app exposes report status without the temporary URL. Call msads.reports.start with a stable request key, the manager and account IDs, an inclusive interval of one to 31 dates, and the report shape.
Choose a report level from account, campaign, adGroup, ad and keyword. Add applicable DeviceType and Network breakdowns, or use an empty list. Select metrics from Impressions, Clicks, Spend, Conversions, Revenue, AllConversions and AllRevenue. Reusing that key with identical inputs answers replayed, and other inputs refuse KeyReused. An invalid key or ID refuses InvalidIdentity. A mount runs one request at a time. It submits once and polls the retained Microsoft report ID at least two minutes apart, for up to 45 minutes. An unavailable download is recovered by polling the same ID for a fresh link. A submission that settles Unknown is never automatically resubmitted. Renew the sealed OAuth access token before it expires. Use reports.status to inspect the result. It returns a workflow failure reason and a structured refusal with code and message when a task supplied one. Use refusalText from @bijectionhq/bijection/client to format that refusal for display. The app accepts one UTF-8 CSV member in a ZIP up to 36 KiB, with up to 48 KiB of CSV and an installer bound of up to 100 rows. It publishes in one commit using the report shape, entity, date and breakdown values as the key. A later explicit report can update those keys. Days omitted by the provider leave their prior observations in place. records.list({ cursor }) returns { facts, next }, at most 31 rows a page; pass next as the following call’s cursor, and start with null. The table is protected, so pages come in row order, not by key. Deployment requires the release-produced ZIP/CSV connector parser. Microsoft Advertising Reporting Service

Campaign Management entities

Mount REST for entity reads. Use providerEndpoint on https://campaign.api.bingads.microsoft.com, with the protected data label and separate sealed Authorization (Bearer prefix) and DeveloperToken (no prefix) header bindings. Set selection to the account ID and limit to at most 100. The campaigns mode reads search campaigns. The ads mode reads responsive search ads and their embedded creative. Each poll requires the whole scope to fit one 36 KiB answer. Keys combine account, query scope and returned entity ID. Missing entities leave prior observations in place.

Conversion writes

Bind a writer with providerWriter for microsoft-advertising.conversions.upload on the Campaign Management origin and pass it in receivers.writers under that mode. Use separate sealed Authorization (with Bearer prefix), DeveloperToken, CustomerId and CustomerAccountId headers. Submit a create command with MicrosoftClickId, ConversionName and ConversionTime in UTC. The receipt requires an empty PartialErrors array. Follow the native write guide and bind the same protected data label to the mount and writer. Each command takes one JSON object up to 24 KiB. The mount binds its key to the exact command and dispatches once. A dispatch that settles Unknown stays unresolved. Acknowledgement does not establish attribution.