You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to explore AD API and I followed the documentation and got all 4 of my tokens. Then I tried this code which showed in the pypi page:
from ad_api.api import sponsored_products
from pprint import pprint
def main():
my_credentials = dict(
refresh_token=getenv("AD_API_REFRESH_TOKEN"),
client_id=getenv("AD_API_APP_ID"),
client_secret=getenv("AD_API_CLIENT_SECRET"),
profile_id=getenv("AD_API_PROFILE_ID")
)
result=sponsored_products.Campaigns(credentials=my_credentials).list_campaigns()
pprint(result)
if __name__ == "__main__":
main()
and I get an AttributeError:
self.credentials = CredentialProvider(account, credentials).credentials
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CredentialProvider' object has no attribute 'credentials'. Did you mean: 'load_credentials'?
I have no idea why I'm getting this error. I checked and have the right credentials.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to explore AD API and I followed the documentation and got all 4 of my tokens. Then I tried this code which showed in the pypi page:
and I get an AttributeError:
I have no idea why I'm getting this error. I checked and have the right credentials.
Beta Was this translation helpful? Give feedback.
All reactions