python amazon cpc advertising api sdk
- 修改 ad_account.py中的信息为你自己的开发者账号
- 获取授权
1获取授权url
from auth import BaseAuth
ba = BaseAuth()
print ba.get_grant_url()
2 获取code
将上一步获取到的url在浏览器打开,输入卖家登陆信息,确认授权,取得code
3获取 access_token 和refresh_token
print ba.get_refresh_token()
3.获取 profile
from profiles import Profiles
profile = Profiles()
print profile.get_profiles()
- example, 使用sdk, 比如获取campaign
from campaigns import Campaigns
profile_id = xxxxxx
access_token = 'xxxxxxxxxxxx'
camp = Campaigns(profile_id,access_token)
camp.list_extended()