locked
GetAccounts For Bing Ads API v9 Oauth RRS feed

  • Question

  • Is GetAccounts call possible in Bing Ads v9 without Oauth AuthenticationToken?.

    Can the password and username authentication be used as in Bing Ads v8? 


    Friday, November 22, 2013 6:59 AM

Answers

  • Is GetAccounts call possible in Bing Ads v9 without Oauth AuthenticationToken?.

    Can the password and username authentication be used as in Bing Ads v8? 


    The v9 API supports username & password authentication for Bing Ads usernames. However if the customer signed up with a Microsoft account then OAuth will be required to authenticate the user. 
    • Proposed as answer by Dare Obasanjo - MSFT Friday, November 22, 2013 1:56 PM
    • Marked as answer by guruv_s Wednesday, December 18, 2013 12:50 PM
    Friday, November 22, 2013 1:48 PM

All replies

  • Is GetAccounts call possible in Bing Ads v9 without Oauth AuthenticationToken?.

    Can the password and username authentication be used as in Bing Ads v8? 


    The v9 API supports username & password authentication for Bing Ads usernames. However if the customer signed up with a Microsoft account then OAuth will be required to authenticate the user. 
    • Proposed as answer by Dare Obasanjo - MSFT Friday, November 22, 2013 1:56 PM
    • Marked as answer by guruv_s Wednesday, December 18, 2013 12:50 PM
    Friday, November 22, 2013 1:48 PM
  • Hi Dare,

    In case the user signed up using a microsoft account. What are the request headers that we need to set. I've set all of them but left the UserName, Password, ApplicationToken fields empty. I still get the invalid credentials errors.

    Can you please help

    Thank you

    Ashok

    Thursday, November 28, 2013 4:51 AM
  • Hi Ashok.

    The DeveloperToken and AuthenticationToken header elements are required for all operations if you are using OAuth. Some operations require CustomerId and CustomerAccountId. It may help to send support your SOAP request and response as described in this guide:
    http://msdn.microsoft.com/en-US/library/aa983155.aspx#engagesupport

    I hope this helps,

    Eric

    Thursday, November 28, 2013 4:41 PM
  • Hi 

    I am trying to call the GetAccountsInfo service. The user linked his microsoft account. I am making the call with the following xml

    <?xml version="1.0" encoding="UTF-8"?>
    <s:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Customer/v9" xmlns:s="htt://schemas.xmlsoap.org/soap/envelope/">
    	<s:Header>
    		<AuthenticationToken>dummy oauth access token</AuthenticationToken>
    		<DeveloperToken>multi user production key</DeveloperToken>
    		<UserName></UserName>
    		<Password></Password>
    		<Action>GetAccountsInfo</Action>
    		<ApplicationToken></ApplicationToken>
    	</s:Header>
    	<s:Body>
    		<tns:GetAccountsInfoRequest>
    			<CustomerId></CustomerId>
    		</tns:GetAccountsInfoRequest>
    	</s:Body>
    </s:Envelope>

    and I am receiving this message as reply

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    	<s:Body>
    		<s:Fault>
    			<faultcode>s:Server</faultcode>
    			<faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring>
    			<detail>
    				<AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    				<TrackingId>7f716a48-a81c-4d1a-9016-165f1893cbe7</TrackingId>
    				<Errors>
    					<AdApiError>
    						<Code>105</Code>
    						<Detail i:nil="true"/>
    						<ErrorCode>InvalidCredentials</ErrorCode>
    						<Message>Authentication failed. Either supplied credentialsare invalid or the account is inactive
    						</Message>
    					</AdApiError>
    				</Errors>
    				</AdApiFaultDetail>
    			</detail>
    		</s:Fault>
    	</s:Body>
    </s:Envelope>

    Can you please help

    Thank you

    Thursday, November 28, 2013 4:53 PM
  • Hello.

    Support would be in a better position to verify your developer token and user credentials. Since the access tokens should not be shared, it would also be a good idea to include the UserId in your support escalation.

    To get details for the current authenticated user specified in the request header, set the UserId element to null or do not specify it in the request to GetUser.

    Regards,

    Eric

    Saturday, November 30, 2013 4:39 PM
  • Hi Dare,

    I have a similar problem. I upgraded from v8 to v9, but GetAccountInfoRequest failed. It doesn't work. 

    In v8, I don't need to specify the "AuthenticationToken" and it works fine. 

    I used the same code in v9, I got error <code>105</code>:

    <Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message>

    We have many clients did not convert to MIcrosoft Account" login, they are still using the Bing Ads "UserName" to login. So, our application need to support "UserName" authentication without "AuthenticationToken".

    Please let me know what I am doing wrong.

    ==== Here is my code =====

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="https://adcenter.microsoft.com/api/advertiser/v9">
    <soap:Header><h:ApplicationToken xmlns:h="https://adcenter.microsoft.com/api/customermanagement"></h:ApplicationToken>
    <h:DeveloperToken xmlns:h="https://adcenter.microsoft.com/api/customermanagement">xxxxxxxxxxx</h:DeveloperToken>
    <h:Password xmlns:h="https://adcenter.microsoft.com/api/customermanagement">aaaaaa</h:Password>
    <h:UserName xmlns:h="https://adcenter.microsoft.com/api/customermanagement">sssss</h:UserName>
    </soap:Header>
    <soap:Body>
    <GetAccountsInfoRequest xmlns="https://adcenter.microsoft.com/api/customermanagement">
    <CustomerId>2222222</CustomerId>
    </GetAccountsInfoRequest>
    </soap:Body>
    </soap:Envelope>


    ======================

    ====== Response ==========

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Server</faultcode><faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring><detail><AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TrackingId>1d587e8f-8a44-4980-9643-3eff07d14ee0</TrackingId><Errors><AdApiError><Code>105</Code><Detail i:nil="true"/><ErrorCode>InvalidCredentials</ErrorCode><Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message></AdApiError></Errors></AdApiFaultDetail></detail></s:Fault></s:Body></s:Envelope>

    =======================

    Sunday, December 8, 2013 5:22 AM