Coder Social home page Coder Social logo

Too difficult about advertising-docs HOT 1 CLOSED

microsoftdocs avatar microsoftdocs commented on July 26, 2024
Too difficult

from advertising-docs.

Comments (1)

eric-urban avatar eric-urban commented on July 26, 2024

@wilminkj although we haven't published a Jupyter notebook example specifically, we have some OAuth samples that should help i.e., here, here, and here. Long story short, for a local app you should register a Native app and use https://login.live.com/oauth20_desktop.srf as the redirect URI. If you are using the Bing Ads Python SDK just use an OAuthDesktopMobileAuthCodeGrant instance and formatting of the scope, redirect_uri, etc should be taken care of. With a localhost web notebook then you could alternatively register https://localhost:portnumber and use the application ID (client_id) and password (client_secret) with the OAuthWebAuthCodeGrant instance.

We will also update this page to link to the samples. This Authentication with OAuth guide describes the grant flow details, and we should at least link to the quick start. :)

Also for more visibility if you share your Jupyter repro steps in the API forum, I'm happy to continue the conversation there.

I did get this example working in a Jupyter notebook.

  1. Install the SDK:
import sys
!{sys.executable} -m pip install --upgrade --no-cache-dir bingads

jupyter-install-bingads

  1. Add the sample code from here with your client_id (Application Id) and DeveloperToken (for production or sandbox).

    Optionally you can include logging to output traffic, for example the SOAP request and response.

    import logging
    logging.basicConfig(level=logging.INFO)
    logging.getLogger('suds.client').setLevel(logging.DEBUG)
    logging.getLogger('suds.transport.http').setLevel(logging.DEBUG)
  2. Click Run, and you'll be prompted for consent of your app to manage your Bing Ads accounts. Copy the result URL with code=xyz back into your notebook and press 'Enter'.

jupyter

By default the refresh.txt file is stored in your local directory by default so please be sure to store it securely.

I hope this helps!

from advertising-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.