- Microsoft Bing Homepage and Search Engine extension is a great way to enrich your browsing experience on Edge. Install this extension to see the beautiful daily image on your homepage and stay up-to-date with the latest trending searches. Access to information across the web is right at your fingertips with direct access to Microsoft Bing search.
- Play the best free games, deluxe downloads, puzzle games, word and trivia games, multiplayer card and board games, action and arcade games, poker and casino games, pop culture games and more.
Bing News
With Bing, search is rewarding. Earn Microsoft Rewards points just for searching the web. Redeem your points for popular gift cards, sweepstakes entries, or even donate them to a charity. Bing definition is - a heap or pile for storage. How to use bing in a sentence.
-->Any Microsoft Advertising user with a developer token can begin using the Bing Ads API. For advertisers placing a large number of ads or developers building advertising tools, the Bing Ads API provides a programmatic interface to Microsoft Advertising.
Bing Images
You can develop your Bing Ads API application in any language that supports web services. To get started with a specific SDK, see Get Started in C# | Java | PHP | Python.
Get a user access token
Consider the user that you want to sign in e.g., example@contoso.com. The Bing Ads API will not accept that email address and password. Instead you need to set the AuthenticationToken header element that contains a user access token. You can think of an access token as representing a user name and password.
How can you get an access token for a user? As an application developer you'll use a Microsoft authorization URL to prompt the Microsoft Advertising user for consent. Once a user provides consent, you can get an access token and act on behalf of the user. The access token represents the user credentials who has access to one or more Microsoft Advertising accounts.
Request user consent for your application to manage their Microsoft Advertising accounts
Tip
For details about how to get access and refresh tokens using the Bing Ads SDKs, see Authentication With the SDKs.
Get a Developer Token
To use Bing Ads APIs, you must have a developer token and valid user credentials. If you do not yet have a Microsoft Advertising account, you can sign up via the Microsoft Advertising web application.
Note
The sandbox and production environments use separate credentials. You can sign up for a Sandbox account here. Everyone can use the universal sandbox developer token i.e., BBD37VB98.
You can follow these steps to get a developer token for production.
- Sign in with Super Admin credentials at the Microsoft Advertising Developer Portal account tab.
- Choose the user that you want associated with the developer token. Typically an application only needs one universal token regardless how many users will be supported.
- Click on the Request Token button.
The universal developer token can be used to authenticate with any Microsoft Advertising user credentials. You can use the same universal developer token whether your application will be used by one or multiple Microsoft Advertising users. As of July 2019, this is the default token type.
The single-user developer token can only be used to authenticate one user for access to one customer. This token type has been deprecated in favor of the universal token. If you still see that a single user token is assigned to one of your users, you can select 'Upgrade to Universal'.
A developer token enables programmatic access to the accounts permitted for a user. Obtaining a developer token for API access does not grant additional permissions to any Microsoft Advertising accounts. Each Microsoft Advertising user is assigned a role e.g., Super Admin or Advertiser Campaign Manager for every customer they can access. With a developer token the same accounts available in the Microsoft Advertising web application are available to the user programmatically through the API.
Where to Use the API Credentials
When you call a service operation such as GetCampaignsByAccountId, you must specify request header elements such as DeveloperToken, CustomerId, and CustomerAccountId.
If you are using one of the Microsoft Advertising SDKs, the request header elements are set using AuthorizationData. For more details about the SDK authentication library see Authentication With the SDKs.
Get Your Account and Customer IDs
To get a user's customer ID and account ID, you can sign in to the Microsoft Advertising web application and click on the Campaigns tab. The URL will contain a cid key/value pair in the query string that identifies your customer ID, and an aid key/value pair that identifies your account ID. For example, https://ui.ads.microsoft.com/campaign/Campaigns.m?cid=FindCustomerIdHere&aid=FindAccountIdHere#/customer/FindCustomerIdHere/account/FindAccountIdHere/campaign.
Do not mistake the account number for the account identifier. The account number is the system-generated account number that is used to identify the account in the Microsoft Advertising web application. The account number has the form xxxxxxxx, where xxxxxxxx is a series of any eight alphanumeric characters. The API service requests only use the account identifier, and never use the account number. Stevie bs guitars clearwater.
With the Customer Management API you can get the customer and account identifiers for each authenticated user.
Call GetUser with your Microsoft Advertising credentials and DeveloperToken. Within the Body set the UserId nil. The response will include a User object that contains the UserId.
Then call SearchAccounts with the UserId returned via the previous step. The returned advertiser account (or accounts) will include account and customer identifiers.
Tip
See Search User Accounts Code Example for a code example that returns accounts for the current authenticated user.
With the Customer Management API you can get the customer and account identifiers for each authenticated user.
Call GetUser with your Microsoft Advertising credentials and DeveloperToken. Within the Body set the UserId nil. The response will include a User object that contains the UserId.
Then call SearchAccounts with the UserId returned via the previous step. The returned advertiser account (or accounts) will include account and customer identifiers.
Tip
See Search User Accounts Code Example for a code example that returns accounts for the current authenticated user.
Header elements reference
Bing Ads API service operations use Simple Object Access Protocol (SOAP) to exchange the request and response messages with the service operation. For more information, see Bing Ads API Services Protocol.
Each SOAP request must include the following SOAP headers, which contain the user's credentials.
Note
The CustomerAccountId and CustomerId elements are not applicable for the Customer Billing and Customer Management services.
Element | Description | Data Type |
---|---|---|
ApplicationToken | This header element is not used and should be ignored. | string |
AuthenticationToken | The OAuth access token that represents a Microsoft Account user who has permissions to Microsoft Advertising accounts. For more information, see Authentication with OAuth. | string |
CustomerAccountId | The identifier of the account that owns the entities in the request. This header element must have the same value as the AccountId body element when both are required. This element is required for most service operations, and as a best practice you should always set it. | string |
CustomerId | The identifier of the customer that contains and owns the account. If you manage an account of another customer, you should use that customer ID instead of your own customer ID. This element is required for most service operations, and as a best practice you should always set it. | string |
DeveloperToken | The developer token used to access the Bing Ads API. | string |
Password | This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. | string |
UserName | This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. | string |
Need Help?
For troubleshooting tips, see Handling Service Errors and Exceptions.
The Microsoft Q&A forum is available for the developer community to ask and answer questions about the Bing Ads APIs and Microsoft Advertising Scripts. Microsoft monitors the forums and replies to questions that the community has not yet answered.
Important
To make sure that we see your question, tag it with 'advertising-api'.
If the investigation involves sensitive account or personal details, or if you are not finding the information you need to solve your problem via Microsoft Q&A, please contact Microsoft Advertising Support. To resolve the issue efficiently, please provide support with the details requested in Engaging Support.
Bing Fun
See Also
Bing
Bing Ads API Overview
Bing Ads API Concepts
Here are the steps to create a Bing Search Service resource through Azure Marketplace and get your key.
- Go to Azure Portal and sign in with your Microsoft account. If you don't have a Microsoft account, click Create one!.
- From the portal, type Bing in the search box.
- Under Marketplace in the search results, select the Bing service you're interested in (for example, Bing Search or Bing Custom Search).
- If you have a free trial or pay account, skip to Create your Bing resource.
- On the Create a free account splash screen, click Start free.
- Next, you have the option of continuing with the free trial (click Start free again) or paying for an Azure subscription (click Or buy now). You can always start with the free trial and pay for a subscription later.
Free trial option
If you clicked Start free, simply follow the sign up process.
- Provide your name and phone number. The process includes this step only if your Microsoft account profile doesn't include your name and phone number.
- Next, verify your identify and phone number. Enter a phone number, if it's not already set. Choose to verify the phone number by using a text verification code or by receiving a phone call.
- Add your credit card information and click Next. Don't worry, you won't be charged during the trial period. Read the No automatic charges section in the right pane.
- Click the check box if you agree to the subscription agreement, offer details, and privacy statement.
- Finally, click Sign up.
You should be redirected back to Azure Portal where you can create a resource and get your key. If Azure wasn't able to redirect you, go to Azure Portal and sign in with your Microsoft account. Back in the portal, type Bing in the search box. Under Marketplace in the search results, select the Bing service you're interested in (for example, Bing Search or Bing Custom Search).
Create your Bing resource
The following steps walk you through creating a Bing Search resource:
Note
While creating Bing Custom Search resource ensure Bing Custom Search is selected as top level service and not 'Bing Search'.
- Enter a resource name. Names may contain alphanumeric characters and dashes (-) only.
- The Subscription field could be set to Free Trial or select your appropriate subscription.
- In the Pricing tier dropdown, select Free F1 package. The other packages are for the pay model. To view package options and pricing for the pay model, click View full pricing details.
- If you have an existing resource group that you want to add this resource to, select it from the Resource group dropdown list. Otherwise, click Create new to create a resource group.
- Select a location from the Resource group location dropdown. The location is where the metadata associated with your account resides and has no impact on runtime availability.
- Click the check the box to indicate that you have read and understood the notice.
- Click Create. This starts the deployment process, which can take several minutes.
- When the deployment process completes, click Go to resource.
- To get your subscription key to use in API calls, click Keys and Endpoint in the left pane.
Bing Rewards
Next steps
Bingo
- Learn about calling the Bing Web Search API.
- Learn about the quickstarts and samples that are available to help you get up and running fast.
- Review Web Search API v7 reference documentation.