|
@@ -320,6 +320,10 @@ class SBClient(BaseClient):
|
|
|
}
|
|
|
return self._request(url_path, method="POST", body=body, headers=headers)
|
|
|
|
|
|
+ def get_campaign_v3(self,campaignId):
|
|
|
+ url_path = f'/sb/campaigns/{campaignId}'
|
|
|
+ return self._request(url_path, method="GET")
|
|
|
+
|
|
|
def iter_campaigns(self, **body) -> Iterator[dict]:
|
|
|
if "maxResults" not in body:
|
|
|
body["maxResults"] = 100
|
|
@@ -373,6 +377,10 @@ class SBClient(BaseClient):
|
|
|
url_path = "/sb/keywords"
|
|
|
return self._request(url_path, method="GET",params=param)
|
|
|
|
|
|
+ def get_keyword(self,keywordid):
|
|
|
+ url_path = f'/sb/keywords/{keywordid}'
|
|
|
+ return self._request(url_path,method="GET")
|
|
|
+
|
|
|
def iter_keywords(self,**param):
|
|
|
if "startIndex" not in param:
|
|
|
param["startIndex"] = 0
|
|
@@ -742,9 +750,9 @@ if __name__ == '__main__':
|
|
|
# keyword=["8mp security camera system","8mp security camera system"],
|
|
|
# matchType=["broad","exact"]))
|
|
|
|
|
|
- sd = Account(**AWS_CREDENTIALS)
|
|
|
- print(sd.get_profilesInfo())
|
|
|
-
|
|
|
+ sd = SBClient(**AWS_CREDENTIALS)
|
|
|
+ # print(sd.get_keywords(**{"campaignIdFilter":"144215934259340472"}))
|
|
|
+ print(sd.get_campaign_v3("144215934259340472"))
|
|
|
# print(sb.get_keyword_bidrecommendation(**{'campaignId': 27333596383941, 'keywords': [
|
|
|
# {"matchType": 'broad', "keywordText": "4k security camera system"}]}))
|
|
|
# a = list(sd.iter_targets(**{"campaignIdFilter":"257424912382921"})) #list(sd.iter_targets())#
|