cca*_*444 5 bing-api python-3.x
我想通过bingads API从我的BingAds中获取我的自定义"报告"数据.我正在使用这个KeywordsAds.py可能不正确的例子.但是,我的问题始于身份验证,我似乎无法找到所需的所有身份验证输入.我错过了类似的例子,所以我知道我是否插入了正确的数据:
authorization_data=AuthorizationData(
account_id='123456789', --instead of just None
customer_id='123456789', --instead of just None
developer_token='12345A1234567891', --instead of just DeveloperTokenGoesHere
authentication='OAuthWebAuthCodeGrant', --instead of just None
Run Code Online (Sandbox Code Playgroud)
)
1)对于上面的代码,authentication我需要为WebAPI选择什么?(2)对于我所说的问题,我是否需要使用WebAPI,或者Web平台是否更有用?
CLIENT_ID='ClientIdGoesHere'
CLIENT_STATE='ClientStateGoesHere'
Run Code Online (Sandbox Code Playgroud)
3)什么是Client_State?我这个词确实谷歌,但没有找到解释.可以/需要插入什么值?
最后,我没有在示例代码中找到client_secret和redirection_uri,但它在Bing的Python入门页面上有说明:
oauth_web_auth_code_grant = OAuthWebAuthCodeGrant(
client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
redirection_uri=REDIRECTION_URI
Run Code Online (Sandbox Code Playgroud)
这有必要填写吗?
所以,我已经在一段时间后解决了这个问题.
第一个代码块是正确的,这就是例子会是什么样子,只需更换中的数字account_id和customer_id.该developer_token所显示我的问题有数字和字母.对于authentication,使用'OAuthWebAuthCodeGrant'.
回答问题1:WebAPI工作,(2)和CLIENT_ID使用WebAPI Application ID URI,后面的部分api://.
Q3:CLIENT_STATE我原样离开,不需要.
他不需要问题的最后一个代码块.
如果你是像我这样的初学者并且需要一些帮助,我制作了一个快速而又脏的Python模板.它下载到我的CSV报告,然后我将它导入到我清理数据集熊猫,然后我又写出来,以CSV,并最终将其上传到谷歌Analytics(分析)在这里
| 归档时间: |
|
| 查看次数: |
709 次 |
| 最近记录: |