Export (0) Print
Expand All

Getting Started With the Bing Ads API

Any Bing Ads user with a developer token can begin using the Bing Ads Application Programming Interface (API). For more information about available services, see Bing Ads API Overview.

Getting 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 Bing Ads account, go to the Bing Ads web application, and click Sign up. To get a developer token for production, login with your Microsoft Account user credentials at the Bing Ads Developer Portal.

The sandbox and production environments use separate credentials. For information about getting immediate access to the sandbox, see Sandbox.

Where to Use the API Credentials

Bing Ads services use Simple Object Access Protocol (SOAP) to exchange the request and response messages with the service operation. For more information, see Bing Ads Services Protocol.

System_CLiX_note Note

In the near future, Bing Ads will transition exclusively to Microsoft Account authentication. New customers are required to sign up for Bing Ads with a Microsoft Account, and to manage those accounts you must use OAuth. Existing users with legacy Bing Ads credentials may continue to specify the UserName and Password header elements. For more information, see Managing User Authentication with OAuth.

Each SOAP request must include some of the following SOAP headers, which contain the user’s credentials.

Element

Description

Data Type

Required

ApplicationToken

The application-access token.

string

No. This header element is not used and should be null.

AuthenticationToken

The OAuth access token used to manage Bing Ads accounts linked to a Microsoft Account. For more information, see Managing User Authentication with OAuth.

string

Required if the UserName and Password elements are not specified.

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.

string

Required for service operations related to ad extensions and bid estimations. As a best practice you should always specify this element for operations limited in scope to a single account per service call.

CustomerId

The identifier of the customer that owns the account.

string

Required for service operations related to targeting and editorial. As a best practice you should always specify this element.

DeveloperToken

The client application's developer access token.

string

Yes.

Password

The Bing Ads user's sign-in password.

string

Required if the AuthenticationToken element is not specified.

UserName

The Bing Ads user's sign-in user name. You may not set this element to a Microsoft account.

string

Required if the AuthenticationToken element is not specified.

Writing Your First Application

You may write your first application from scratch or start with an example.

For examples that show how to get service header elements including account and customer identifiers, see C# | Java | Perl | PHP | Python | Ruby | VB.

System_CLiX_note Note

Many Bing Ads service operations require an account ID and some require a customer ID. For more information on getting your customer ID and account ID, see Account and Customer Identifiers.

For examples that show how to get campaigns, see C# | Java | Perl | PHP | Python | Ruby | VB.

For additional code examples in C#, Java, Perl, PHP, Python, Ruby, and VB, see Bing Ads Code Examples.

System_CLiX_note Note

Many code examples demonstrate programming concepts with the UserName and Password elements. For Managing User Authentication with OAuth, replace the UserName and Password elements with the AuthenticationToken, which is your OAuth access token.

For details about getting started writing Bing Ads applications in these languages, see C# | Java | Perl | PHP | Python | Ruby | VB.

See Bing Ads API Version 8 Reference for definitions of programming elements and web service addresses.

Need Help?

For troubleshooting tips, see Handling Service Errors and Exceptions.

To get answers to your questions, you can use the Bing Ads API Development forum. Microsoft monitors the forums and replies to questions that the community has not yet answered.

If you cannot find the information you need to solve your problem in the developer forum, contact Bing Ads Support.

Community Additions

Show:
© 2014 Microsoft