该模块为百度商业API SDK的Python实现。 包含两个模块:
- baiduads-sdk:手动开发的sdk部分
- baiduads-sdk-auto: 自动生成的sdk部分
Python >= 3.6
python setup.py install
pip install baiduads-sdk
以api: /json/sms/service/AccountService/getAccountInfo
为例:
class TestAccountService(unittest.TestCase):
"""AccountService unit test stubs"""
def setUp(self):
self.api = AccountService() # noqa: E501
def tearDown(self):
pass
def test_get_account_info(self):
# init header
api_header = ApiRequestHeader(username="********",
password="********",
token="****************",
_spec_property_naming=True)
# init request
get_account_req = ApiAccountQueryRequest(accountFields=["pictureOptimizeSegmentStatus"],
_spec_property_naming=True)
# init request wrapper
req_wrapper = GetAccountInfoRequestWrapper(header=api_header,
body=get_account_req,
_spec_property_naming=True)
resp_wrapper = self.api.get_account_info(req_wrapper)
assert resp_wrapper.header.status == 0
Class | Method | HTTP request | Description |
---|---|---|---|
CampaignFeedService | addCampaignFeed | POST /json/feed/v1/CampaignFeedService/addCampaignFeed | |
CampaignFeedService | deleteCampaignFeed | POST /json/feed/v1/CampaignFeedService/deleteCampaignFeed | |
CampaignFeedService | getCampaignFeed | POST /json/feed/v1/CampaignFeedService/getCampaignFeed | |
CampaignFeedService | updateCampaignFeed | POST /json/feed/v1/CampaignFeedService/updateCampaignFeed |
百度如流讨论群:5995216