Coder Social home page Coder Social logo

Comments (8)

dylanlingelbach avatar dylanlingelbach commented on April 18, 2024

This seems to be more general than the specific case I have above. It seems like any call that creates an object does not flow the api instance.

I am using version 2.3.3 of this library.

from facebook-python-business-sdk.

ebzlo avatar ebzlo commented on April 18, 2024

Hey @dylanlingelbach, we don't flow the api object in the manner you're describing (but that might be a good PR). The flow you're using would require the following call after you instantiate the FacebookAdsApi object:

api = FacebookAdsApi(session)
FacebookAdsApi.set_default_api(api)

Alternatively, you can skip creating the session and creating the FacebookAdsApi object by doing the following:

api = FacebookAdsApi.init(app_id, app_secret_access_token)
me = AdUser(fbid='me', api=api)
ad_account = me.get_ad_account()
assert ad_account.get_api() == api

from facebook-python-business-sdk.

wpromatt avatar wpromatt commented on April 18, 2024

@ebzlo Then why does the readme documentation say that using multiple access tokens is supported and the only area where you have to again pass the api instance is with class methods?

From here, all the following workflow for these objects remains the same. The only exceptions are the classmethods calls, where we now should pass the api we want to use as the last parameter on every call.

from facebook-python-business-sdk.

JDaance avatar JDaance commented on April 18, 2024

I vote that the API should flow to all fetched objects!

How would I set the api on the fetched objects afterwards as it is now? I can't use set_default_api as I have many users at the same time.

from facebook-python-business-sdk.

dylanlingelbach avatar dylanlingelbach commented on April 18, 2024

@JDaance: you can use our forked version: https://github.com/Evzdrop/facebook-python-ads-sdk

We try to keep it up to date and have a few other changes there but should get you pointed in the right direction.

Hope this helps!

from facebook-python-business-sdk.

dylanlingelbach avatar dylanlingelbach commented on April 18, 2024

@rituparnamukherjee - was this fixed or no longer an issue in later versions of the SDK? Or are you saying you aren't going to fix this?

from facebook-python-business-sdk.

rituparnamukherjee avatar rituparnamukherjee commented on April 18, 2024

@dylanlingelbach

Apologies for confusion. We have updated quite a bit on the SDK. Would you mind sending out a PR for this off of the latest SDK version.

from facebook-python-business-sdk.

dylanlingelbach avatar dylanlingelbach commented on April 18, 2024

@rituparnamukherjee - ok, our solution is not ready for a PR, it is a pretty quick hack. Can we leave this open until you fix or we open a PR?

from facebook-python-business-sdk.

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.