Bing Adcenter API Essentials for Microsoft Advertising

Author

Reads 1.3K

Macro shot of a bumblebee gathering nectar on a vibrant yellow flower, showcasing nature's beauty.
Credit: pexels.com, Macro shot of a bumblebee gathering nectar on a vibrant yellow flower, showcasing nature's beauty.

To get started with Bing Adcenter API, you'll need to create a Microsoft Advertising account. This account will serve as the foundation for accessing and utilizing the API.

Microsoft Advertising offers a free tier, allowing you to access the Adcenter API without incurring costs. This tier is perfect for testing and experimenting with the API.

To use the Bing Adcenter API, you'll need to register for an account on the Microsoft Advertising website. This step is straightforward and requires minimal information.

The Microsoft Advertising account will provide you with a Client ID and Client Secret, which are essential for authenticating and authorizing API requests.

Microsoft Advertising

To get started with Microsoft Advertising, you'll need to sign up for a Microsoft Advertising account if you don't already have one. This will give you access to the Microsoft Advertising Developer Portal.

The Microsoft Bing Ads API uses a SOAP (Simple Object Access Protocol) API, which is a good thing to know if you're planning to integrate it with other systems. Microsoft Advertising API (Bing Ads API) provides a programmatic interface to Microsoft Advertising insights.

Credit: youtube.com, Bing Ads Becomes Microsoft Advertising - Ep. 68

To get a developer account for Microsoft Bing Ads API integration, you'll need to request API access by submitting a form to Microsoft Advertising support. Once approved, you can sign in to the Microsoft Advertising Developer Portal with your Super Admin credentials.

You'll need a developer token to enable programmatic access to the accounts permitted for your user. You can get this token by going to the Account tab in the Developer Portal. To make API calls, you'll also need your account ID and customer ID, which can be retrieved via the Customer Management API or found in the URL when signed into the Microsoft Advertising web interface.

Microsoft provides SDKs for easier integration in languages like .NET, Java, PHP, and Python. These SDKs can save you a lot of time and effort when building your application.

Here are the key steps to get a developer account for Microsoft Bing Ads API integration:

  1. Sign up for a Microsoft Advertising account if you don't already have one.
  2. Request API access by submitting a form to Microsoft Advertising support.
  3. Once approved, sign in to the Microsoft Advertising Developer Portal with your Super Admin credentials.
  4. Go to the Account tab in the Developer Portal to get your developer token.
  5. The developer token enables programmatic access to the accounts permitted for your user.
  6. You'll also need to get a user access token to authenticate API requests.
  7. To make API calls, you'll need your account ID and customer ID in addition to the developer token and access token.

API Basics

Credit: youtube.com, How to request ad report data through API? | Beginner Friendly | Microsoft Bing API

To use the Bing Adcenter API, you'll need to meet some basic requirements. Each task requires a Microsoft Azure Application, which you can register by following the instructions at https://learn.microsoft.com/en-us/advertising/guides/authentication-oauth-register?view=bingads-13.

You'll also need a Bing Advertising Manager Account and ID, a Bing Advertising Ad Account and ID, and a Developer Token. The Developer Token is granted by Microsoft and can be used to authenticate with any Microsoft Advertising user credentials. To request a Developer Token, follow the steps at https://learn.microsoft.com/en-us/advertising/guides/get-started?view=bingads-13#get-developer-token.

Here are the key requirements you'll need to get started with the Bing Adcenter API:

  • A Microsoft Azure Application
  • A Bing Advertising Manager Account and ID
  • A Bing Advertising Ad Account and ID
  • A Developer Token
  • An Authentication Token
  • An audience file for upload

Access and Refresh Tokens

To access and manage a Microsoft Advertising account programmatically, you need to obtain an Access Token and a Refresh Token. Each Microsoft Advertising user must grant consent for your application to access their accounts.

The Access Token is short-lived, so you'll need to use the Refresh Token to obtain a new one when it expires. You can use the Get-Tokens-Production.ps1 PowerShell script to generate both tokens.

Credit: youtube.com, API Authentication: JWT, OAuth2, and More

To use the script, you'll need to provide your Application Id and Client Secret, if you have a web application. You can save the script to a file named Get-Tokens-Production.ps1 and run it in a console window. The script will start a browser session where you enter your Microsoft Advertising credentials and grant consent.

After consenting, the browser's address bar will contain a grant code, which you'll need to copy and enter in the console window. The script will then return the Access Token and Refresh Token.

Remember to treat these credentials like a password, as they provide access to your resources. If someone gets hold of the Refresh Token, they'll have access to your resources, even if the Access Token has expired.

Get Upload URL

To get the file upload URL, you must use Bing's Bulk Service API Webservice, which utilizes the SOAP protocol. This requires manually creating the SOAP envelope within DM.

Credit: youtube.com, API: to upload files and get URL free.

The order of the parameters in the SOAP Header and Body must match those below.

The URL for the Bulk Service API is https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/BulkService.svc.

You'll need to make a POST request with the following fields:

The SOAP Body requires the following fields:

Get Upload Status

To get the upload status of a customer match list file, you can use the RequestId to query the Bing API. This requires manually generating a SOAP envelope.

You'll need to specify the Content-Type as "text/xml" and the SOAPAction as "GetBulkUploadStatus".

To send the request, you'll need to include the following fields in the SOAP envelope: Action, AuthenticationToken, CustomerAccountId, CustomerId, and DeveloperToken.

Actions

To set up an action in an API, you'll need to enter a name for it. This name will help you identify the action later on.

The next step is to select the action type from a drop-down menu. This will determine how the action behaves and what it can do.

Credit: youtube.com, API tutorial for Beginners step by step - 5 - models and controllers actions

In most cases, you'll need to set up parameters and options for each action. This can include things like data formats, authentication methods, and error handling.

The specific parameters and options will depend on the action type you've chosen. Make sure to review the documentation for your chosen action type to see what's required.

Campaign Management Data Models

Campaign Management Data Models allow for CRUD operations, which include Create, Read, Update, and Delete actions, where applicable. This enables efficient management of campaign data.

The Bing Ads API supports retrieving performance data and generating reports for campaign management data models. This feature is particularly useful for analyzing campaign performance over time.

Bulk operations are supported, and the API allows for partial success, making it easier to manage large datasets. This is especially helpful when dealing with numerous campaigns or ad groups.

You might like: Google Data Studio Api

Customer Match

To create a customer match list, you'll need to follow these steps: First, call the Bing API to retrieve a file upload location. Once you have that, you must then post the CSV file to the file upload location. Bing will then return a RequestId that can be used to query the status of the file upload until completion.

Take a look at this: Cloudinary Upload Api Nextjs

Credit: youtube.com, How Do I Use Customer Match In Bing Ads? - SearchEnginesHub.com

To create a customer match list, you'll need to provide some required information. The AccountId is a string that identifies the ad account that owns or is associated with the entities in the request. This must match the value in the CustomerAccountId header.

The ResponseMode is also required and can be either "ErrorsOnly" or the default, which also returns errors and their corresponding data.

A customer match list file is used to both create new Customer Match Lists and to add emails to the lists. The file is sent to the same File Upload URL endpoint referenced earlier, which can be confusing.

The file format requires the first row to contain column headers, the second row to declare the Format Version, and the third row to define the Customer List to be acted upon. The ID column must either match an existing Customer Match List or contain a negative number to create a new one.

Here's a summary of the required information for the first three defining rows of the CSV file:

Configure Settings

Credit: youtube.com, Bing Ads – Full Setup Guide

To configure settings for the Bing AdCenter API, you'll need to add the connector first. After that, you can start setting up the necessary information.

First, you'll need to find your Customer ID. This can be found in the URL after CID= when you're logged into the Microsoft Ads UI.

You'll also need to find your Account ID, which is located in the URL after AID= when logged into the Microsoft Ads UI.

Here are the settings you'll need to configure:

  • Customer ID: required, found in the URL after CID= in the Microsoft Ads UI
  • Account ID: required, found in the URL after AID= in the Microsoft Ads UI

Data Management

The Bing Ads API allows for CRUD operations (Create, Read, Update, Delete) for applicable data models.

With CRUD operations, you can efficiently manage your data and perform tasks such as creating new campaigns, reading existing ad groups, updating ad copy, and deleting underperforming ads.

You can also use the API to retrieve performance data and generate reports to help you make informed decisions.

The API supports partial success for bulk operations, which is particularly useful for managing large datasets.

This means you can execute multiple operations at once without having to worry about the entire operation failing if one part of it encounters an issue.

By leveraging the Bing Ads API's data management features, you can streamline your workflow and focus on driving results for your campaigns.

Here's an interesting read: Azure Active Directory Graph Api

Usage and Limits

Credit: youtube.com, R : Bing Ads API Reporting Data with R - get ReportRequestId

To use the Bing Ads API, you'll need a developer token and valid user credentials. This is a crucial step to get started.

Developers can choose from various SDKs, including C#, Java, PHP, and Python, to simplify their development process. These SDKs are provided by Microsoft to make it easier for developers to integrate the API into their applications.

To manage Microsoft Advertising accounts, developers need to request user consent for their application. This ensures that users are aware of how their data will be used.

Here are the key API rate limits for the Microsoft Bing Ads API:

The API uses throttling to limit the number of calls any one user can make in a minute's time. Exceeding the service call limit will result in an error.

Usage

The Bing Ads API connector introduces a new virtual schema called bingads, which contains several stored procedures.

To access these procedures, you'll need to navigate through the virtual schema. This allows you to manage Microsoft Advertising accounts programmatically.

You can delete the example views directly by dropping bingads_examples if you don't need them.

Rate Limits and Limitations

Credit: youtube.com, Understanding Rate Limits & How To Bypass It? | Live Demonstration | 2024

The Microsoft Bing Ads API has strict rate limits in place to prevent abuse and ensure fair usage.

These limits are designed to prevent any one user from making too many calls in a short period of time.

If you exceed the service call limit, you'll receive an error with the code 117 and a message indicating that you've exceeded the allowed number of calls per minute.

You should wait 60 seconds before resubmitting the request to avoid getting this error again.

Here's a summary of the error you'll receive:

  • Error Code: 117
  • Error Message: "You have exceeded the number of calls that you are allowed to make in a minute. Please reduce the number of calls that you make per minute."

Best Practices

Implementing retry logic in your code is crucial to handle throttling errors gracefully. This will help prevent your application from crashing due to repeated API call failures.

To stay within the limits, space out your API calls to avoid overwhelming the system. This can be achieved by incorporating a delay between API calls.

Batching operations is a great way to reduce the number of individual API calls. By grouping related tasks together, you can minimize the number of requests made to the API.

Credit: youtube.com, API Best Practices Webcast – June 2017

Monitoring your API usage is essential to ensure you're not consistently approaching the limits. This will help you identify areas where you can optimize your code.

Here are some key best practices to consider:

  • Implement retry logic in your code.
  • Space out your API calls.
  • Batch operations where possible.
  • Monitor your API usage.

Regularly checking the release notes for updates and changes to the API is a must. This will help you stay up-to-date with the latest features and improvements.

Using the provided SDKs when possible is a great way to ensure you have the latest features and updates. These SDKs are maintained by Microsoft and are regularly updated to support the latest API features.

To authenticate API requests, you need both the developer token and user access token. Make sure to enable multi-factor authentication, as it's now required.

Here are some key points to consider:

  • There are separate credentials for sandbox and production environments.
  • The universal developer token can be used for multiple users/accounts.
  • You need both the developer token and user access token to authenticate API requests.
  • Enable multi-factor authentication.

Pre-requisites and Requirements

To get started with the Bing AdCenter API, you'll need to meet some pre-requisites and requirements.

You'll need a ClientId, ClientSecret, and RefreshToken to gain access to the API. These can be obtained through the Microsoft Azure portal.

Credit: youtube.com, Bing Ads to Azure SQL in 2 minutes

You'll also need a Microsoft Azure Application, which can be registered through this link: https://learn.microsoft.com/en-us/advertising/guides/authentication-oauth-register?view=bingads-13.

In addition, you'll need a Bing Advertising Manager Account and ID, as well as a Bing Advertising Ad Account and ID. These can be found in the Microsoft Advertising web interface.

You'll also need a Developer Token, which can be obtained by following these steps: https://learn.microsoft.com/en-us/advertising/guides/get-started?view=bingads-13#get-developer-token. This token is required for authentication and can be used with any Microsoft Advertising user credentials.

Here are the specific requirements for each task:

  • A Microsoft Azure Application
  • A Bing Advertising Manager Account and ID
  • A Bing Advertising Ad Account and ID
  • A Developer Token
  • An AuthenticationToken
  • An audience file for upload

Rosemary Boyer

Writer

Rosemary Boyer is a skilled writer with a passion for crafting engaging and informative content. With a focus on technical and educational topics, she has established herself as a reliable voice in the industry. Her writing has been featured in a variety of publications, covering subjects such as CSS Precedence, where she breaks down complex concepts into clear and concise language.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.