baidu / baiduads-sdk Goto Github PK
View Code? Open in Web Editor NEWBaidu Ads API SDK
Home Page: https://dev2.baidu.com/
License: Apache License 2.0
Baidu Ads API SDK
Home Page: https://dev2.baidu.com/
License: Apache License 2.0
house.baidu.com
目前baiduads-sdk 使用 [openapi-generator](https://github.com/OpenAPITools/openapi-generator) 生成代码
Originally posted by @JoeCqupt in #25 (comment)
目前最新版(2023.1.0)中缺少以下两个方法:
删除RTA策略配置账户(delStrategyConfigUsers)
追加RTA策略配置账户(addStrategyConfigUsers)
sdk版本
<dependency>
<groupId>com.baidu.dev2</groupId>
<artifactId>baiduads-sdk</artifactId>
<version>2023.1.0</version>
</dependency>
报错提示com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not found
原因是因为我logback.xml文件配置了
<springProfile name="test|prod">
<root level="info">
<appender-ref ref="logstash"/>
</root>
</springProfile>
发现去掉之后正常可以启动
翻了下源码发现是这里会自动加载
吐槽一下,一启动就直接挂掉,没有任何错误信息,排查了一天,最后还是在main方法try 一下,发现是没有此com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule导致的
try {
SpringApplication.run(Application.class, args);
} catch (Throwable e) {
e.printStackTrace();
}
现解决方案是再加个jackson-module-jaxb-annotations的依赖
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
</dependency>
问一个初级的问题……
`import urllib.parse
import urllib.request
import json
url = "https://u.baidu.com/oauth/accessToken"
header = {
"userName" : "我的userName",
"accessToken" : "我的accessToken"
}
body = {
"appId": "我的appId",
"authCode": "我的authCode",
"secretKey": "我的secretKey",
"grantType": "auth_code",
"userId": 我的userId
}
jsonDict = {'header':header, 'body':body}
jsonStr = json.dumps(jsonDict, ensure_ascii = False)
jsonStr = jsonStr.encode('utf-8')
print(jsonDict)
headers = {'content-type': 'application/json;charset=utf-8'}
req = urllib.request.Request(url, data=jsonStr, headers=headers)
page = urllib.request.urlopen(req)
html = page.read()
jsondata = json.dumps(html.decode('UTF-8'))
#print(jsondata)
dictdata = json.loads(json.loads(jsondata))
print(dictdata)`
运行后,百度返回了错误码给我:
{'code': 3, 'data': {}, 'message': '参数错误:授权账号 userId 不符合规范;应用 appId 不能为空;临时授权码 authCode 不能为空;应用密钥 secretKey 不能为空;!'}
可是我的参数都在data中带了,为什么获取不到授权令牌?
可以追加PHP-DEMO吗
目前缺少golang和PHP的版本,对于很多开发者不是很方便
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.