-
-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Description
Since the request body for update ad groups in sponsored products is as follows:
{
"adGroups": [
{
"name": "string",
"state": "ENABLED",
"adGroupId": "string",
"defaultBid": 0.1
}
]
}
When sending request for updating ad groups, it is like:
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)meanwhile the request body for updating ad groups in sponsored brand:
{
"adGroups": [
{
"name": "string",
"state": "ENABLED",
"adGroupId": "string"
}
]
}
When sending request for updating ad groups
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False) , params=kwargs, headers=headers)Therefore, they have something in common. when update this two kinds of ad group in a loop while, it could goes like:
def demo(ad_group_category = "sp"):
ad_group_class = {"sb": "AdGroupsV4", "sp": "adGroupv3"}
ad_group_client = ad_group_class["ad_group_category"]
ad_groups = [{"name": "demo", "adGroupId": "123458992", "state": "ENABLED"}]
try:
ad_group_client.edit_ad_groups(body={"adGroups": ad_groups})
except Exception:
passMetadata
Metadata
Assignees
Labels
No labels