# Bing Ads

### Connecting to Bing Ads

You need to register a Bing Ads account, get a developer token, and authenticate using OAuth to connect to the Bing Ads APIs.

### Register a Bing Ads Account

Complete the following steps to sign up for a Bing Ads account and obtain the CustomerId and (optional) AccountId:

1. Sign up for a Bing Ads account in the [Bing Ads Web application](https://ads.microsoft.com/Default.aspx) or at the [Sandbox Site](https://secure.sandbox.bingads.microsoft.com/) for a sandbox account.
2. Select **Settings > Accounts and Billing** and select a single account. The AccountId and CustomerId (cid) are displayed on the account's page and in the page's URL.

### Get a Developer Token

To use the Bing Ads APIs, you must have a DeveloperToken in addition to the CustomerId. You must have the Super Admin role in Bing Ads to create a developer token, though you do not need special permissions to use the token.

1. Log in at the [Bing Ads Developer Portal](https://developers.ads.microsoft.com/Account) as a Microsoft Account user with the Bing Ads Super Admin role.
2. Click **Request Token** and take note of your developer token. You will set it in the DeveloperToken connection property.

### Authenticate via OAuth Authentication

The Bing Ads APIs use the OAuth 2 standard.&#x20;

1. If you have not done so already, sign up for a Bing Ads account in the [Bing Ads Web application](https://ads.microsoft.com/Default.aspx) or at the [Sandbox Site](https://secure.sandbox.bingads.microsoft.com/) for a sandbox account.
2. Go to the [Azure portal](https://portal.azure.com) ([Azure test portal](https://df.onecloud.azure-test.net) for sandbox accounts), and login with your Microsoft Account credentials when prompted.
3. Under Azure Active Directory --> App registrations, click New registration.
4. Provide the application name and select an appropriate Supported account type. Not selecting to allow personal Microsoft accounts will prevent users with personal accounts from authenticating.
5. &#x20;Set the Redirect URI to the page in your Web application where you would like users to be redirected with the OAuthVerifier
6. Register your application and take note of your Application (client) Id. You will use it as the OAuthClientId value in the OAuth grant flow.
7. In the Certificates & secrets section, click New client secret to generate a client secret and take note of the resulting value. You will use it as the OAuthClientSecret value.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/marketing/bing-ads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
