none
Connecting to the bing ads API without user interaction? RRS feed

  • Question

  • Hi guys,

    I'm working on a script to collect reporting data (CPC, hits and so on) from the bing ads API v11 without user interaction. The goal for the script is to trigger periodic by a scheduler and collect data which it stores to a local database.

    Now I went trough the documentation on oauth2 to configure the authentication but it doesn't specify clearly how to make the call the API silently. From the documentation:

    2. The user will be prompted through the Microsoft Account authorization web browser control to grant permissions for your application to manage their Bing Ads accounts.

    Clearly this is not what I want. :( Ideally I would like to generate a token file (or a token string of some kind) that can be stored on the server so that the API can authenticate silently and run periodically. The token has to be long live so I can deploy it and forget about it.

    Questions:

    • How do I connect without user interaction to the bing reporting API v11?
    • What do I need in terms of auth / what do I need to configure? Documentation doesnt specify silent API calls?

    Last but not least, I can't use a SDK since I'm using the R programming language for which there is no SDK availble. I'm going to make the API calls plain with http (curl like style) from the R script.

    https://www.r-project.org/
    https://msdn.microsoft.com/en-us/library/bing-ads-user-authentication-oauth-guide(v=msads.100).aspx#registerapplication






    • Edited by Rainb0w Friday, June 2, 2017 1:20 PM
    Friday, June 2, 2017 12:52 PM

Answers

  • Hello.

    One time user interaction / consent is required for OAuth. Thereafter you can store the resulting refresh token to get new refresh and access tokens without user interaction. Please see the section about Authorization Code Grant Flow, and let me know if you have any follow up questions. The sample request/response on that page is HTTPS and not specific to any SDK.

    Best regards,

    Eric

    Friday, June 2, 2017 2:03 PM
    Owner