Account and Customer Identifiers
Many Bing Ads service operations require an account ID and some require a customer ID.
Account Identifier
The account identifier is a numeric identifier that identifies an account. The SignupCustomer operation returns the account identifier. You can also use the GetAccountsInfo operation to retrieve an account identifier for the specified customer. However, it is more efficient to store your account identifier locally so you can access it when needed.
Many of the campaign management operations require that you specify the account identifier in request message. For example, the GetCampaignsByAccountId operation returns all of the campaigns for the account that you specify in the request message.
Do not confuse the account identifier with the account number, which is used in the Bing Ads web application to identify the account. The account number takes the form of Xnnnnnnn, where nnnnnnn is a series of digits (for example, X7891234). The API uses only the account identifier, never the account number.
Customer Account Identifier
The customer account identifier is the same as the account identifier. The campaign management operations require that you specify the account identifier in the CustomerAccountId SOAP request header element.
Although the Reporting web service includes the CustomerAccountId header element in the WSDL definition, it does not use it.
Customer Identifier
The customer identifier is the numeric identifier that identifies a customer. You specify the customer identifier in the CustomerId SOAP request header element. Most campaign management operations do not require the customer identifier. Only operations that use data objects that are stored at the customer level—such as targets—require the customer identifier.
Although the Reporting web service includes the CustomerId header element, it does not use it.
The SignupCustomer operation returns the customer identifier. You can also use any one of the following options to get the customer identifier; however, it is more efficient to store your customer identifier locally so that you can access it when needed.
-
Use the GetAccount operation to get an account that the customer owns. Then, access the ParentCustomerId element, which contains the customer identifier.
-
Use the GetCustomersInfo to get the customer identifiers for a list of customers that you specify by name.
-
Use the Bing Ads web application. To find the customer identifier, click the Accounts & Billing tab, and then click the Company Information tab. The customer identifier is listed next to Customer ID.
-
Use the Bing Ads Editor. The customer identifier displays as a tool tip when you move the pointer over the customer’s name.
Getting Your Account ID and Customer ID
To get a user’s customer ID and account ID, you can sign in to the Bing Ads web application and click on an account within Accounts & Billing. 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://bingads.microsoft.com/cc/Account/Details?cid=1030&aid=49943.
To programmatically get all of the customer IDs that you have permissions to access, call the GetCustomersInfo operation. To programmatically get all the account IDs that you have permissions to access, call the GetAccountsInfo operation. For examples that show how to get account and customer identifiers, see C# | Java | Perl | PHP | Python | Ruby | VB.
Resellers that call the SignupCustomer operation to sign up new customers can get the new customer’s account ID and customer ID in the response message.
Many of the campaign management operations require that you specify the account ID in the request message, but all of them require that you specify the account ID in the CustomerAccountId header element.
For the campaign management APIs, you should specify the identifier of the customer that owns the account in the CustomerId header element; however, only operations that store data at the customer level (such as targets and business objects), require you to set the CustomerId header element. Operations that require you to specify the customer ID will state this in the Remarks section of the request message topic.