BingAds

Official documentation: BingAds API docs

Authentication

BingAds uses API key authentication.

  1. Go to the Connections page and create a New Connection
  2. Select BingAds Reporting API from the Connector dropdown
  3. Enter a Connection name
  4. Fill in the following credentials:
Field Required
Client Id ✅
Client Secret ✅
Developer Token ✅
Refresh Token ✅
Redirect Uri ✅

Follow these steps in order to start using the hibase connector to the Microsoft Bing Ads API:

  1. Log into your Microsoft Advertising account as Super Admin and navigate to the Developers Portal

  2. Select which user you want to use in order to log in from hibase and hit Request Token in order to get your Developer Token

  3. Register a new app in your Azure account with the following settings:

  • Name: hibase Bing Ads Reporting API
  • Supported account types: Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)
  • Redirect URI: https://localhost
  1. Take note of the Client ID that is displayed at the top of your new App's page

  2. Navigate to the Certificates & secrets page of your App and click on New client secret to issue a new secret. Take note of it as it will be required later in the process

  3. In your browser, navigate to the following URL after replacing Client ID with the values you noted above:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=[Client ID]&scope=openid%20profile%20https://ads.microsoft.com/msads.manage%20offline_access&response_type=code&redirect_uri=https://localhost&prompt=login
  1. After granting access to the application, you will be redirected to your localhost, most likely resulting in a "This site can't be reached" page in your browser. Copy the URL from the URL bar and take note of the value of the code param therein included. This is the Authorization Code you will need in the following step

  2. Issue a POST request as follows, replacing all the values in brackets with the ones you noted above (the example is using curl):

curl -v -X POST \
  --data-urlencode "grant_type=authorization_code" \
  --data-urlencode "client_id=[Client ID]" \
  --data-urlencode "code=[Authorization Code]" \
  --data-urlencode "scope=offline_access https://ads.microsoft.com/msads.manage openid profile" \
  --data-urlencode "redirect_uri=https://localhost" \
  --data-urlencode "client_secret=[Client Secret]" \
  https://login.microsoftonline.com/common/oauth2/v2.0/token
  1. Take note of the Refresh token provided in the response

  2. Provide your Client ID, Client Secret, Developer Token and Refresh Token to the hibase connector for Microsoft Graph when adding it to your account. Additionally. write https://localhost as Redirect Uri

You are now ready to start using the Microsoft Bing Ads Reporting API connector for hibase

Endpoints

Download (API docs)

Download a previously generated report file from the Microsoft Advertising reporting service.

Parameter Description Required
download_url The URL provided by PollGenerateReport once the report status is Success. ✅

Returned Data: Returned as CSV. Columns are determined by the API response headers.

Poll Generate Report (API docs)

Poll the status of a previously submitted report request. Returns the download URL when the report is ready.

Parameter Description Required
customer_id The identifier of the customer that owns the account. ✅
customer_account_id The identifier of the account that contains the data for the report. ✅
report_request_id The identifier of the report request returned by Report Request. ✅

Returned Data

Column Type
report_download_url string

Report Request (API docs)

Submit an asynchronous report generation request to the Microsoft Advertising Reporting API.

Parameter Description Required
customer_id The identifier of the customer that owns the account. ✅
customer_account_id The identifier of the account that contains the data for the report. ✅
report_type The type of report to generate. Values: AccountPerformanceReport, CampaignPerformanceReport, AdGroupPerformanceReport, AdPerformanceReport, KeywordPerformanceReport, SearchQueryPerformanceReport, AudiencePerformanceReport, GoalsAndFunnelsReport, BudgetSummaryReport ✅
start_date The start date for the report data (format: YYYY-MM-DD). ✅
end_date The end date for the report data (format: YYYY-MM-DD). ✅
columns Comma-separated list of report columns to include. ✅
filter_xml Optional XML filter to narrow report data by specific criteria (e.g. campaigns, ad groups). —
report_time_zone The time zone to use for the report date range. —
aggregation The time period for aggregating report data. Values: Summary, Hourly, Daily, Weekly, Monthly, Yearly —
time_zone The time zone to use for the report. Values: EasternTimeUSCanada, CentralTimeUSCanada, MountainTimeUSCanada, PacificTimeUSCanada, GreenwichMeanTimeDublinEdinburghLisbonLondon, AmsterdamBerlinBernRomeStockholmVienna —

Returned Data

Column Type
report_request_id string